diff --git a/build/Build_CodeBlocks.bat b/build/Build_CodeBlocks.bat deleted file mode 100644 index f660c144d..000000000 --- a/build/Build_CodeBlocks.bat +++ /dev/null @@ -1 +0,0 @@ -.\premake5.exe codeblocks diff --git a/build/Build_CodeLite.bat b/build/Build_CodeLite.bat deleted file mode 100644 index 2a1634776..000000000 --- a/build/Build_CodeLite.bat +++ /dev/null @@ -1 +0,0 @@ -.\premake5.exe codelite diff --git a/build/Build_VS2015.bat b/build/Build_VS2015.bat deleted file mode 100644 index 8657a02cb..000000000 --- a/build/Build_VS2015.bat +++ /dev/null @@ -1 +0,0 @@ -.\premake5.exe --premakeproject vs2015 diff --git a/build/Build_VS2017.bat b/build/Build_VS2017.bat deleted file mode 100644 index c172c5a59..000000000 --- a/build/Build_VS2017.bat +++ /dev/null @@ -1 +0,0 @@ -.\premake5.exe --premakeproject vs2017 diff --git a/build/Build_VS2019.bat b/build/Build_VS2019.bat deleted file mode 100644 index f9dd7c987..000000000 --- a/build/Build_VS2019.bat +++ /dev/null @@ -1 +0,0 @@ -.\premake5.exe --premakeproject vs2019 diff --git a/build/EncodeResources.bat b/build/EncodeResources.bat deleted file mode 100644 index b7dc0f860..000000000 --- a/build/EncodeResources.bat +++ /dev/null @@ -1,2 +0,0 @@ -.\premake5.exe encoderesources -pause diff --git a/build/Generate_GlobalIncludes.bat b/build/Generate_GlobalIncludes.bat deleted file mode 100644 index df132e9ad..000000000 --- a/build/Generate_GlobalIncludes.bat +++ /dev/null @@ -1,2 +0,0 @@ -.\premake5.exe generateheaders -pause diff --git a/build/Generate_UnicodeData.bat b/build/Generate_UnicodeData.bat deleted file mode 100644 index cff81bd31..000000000 --- a/build/Generate_UnicodeData.bat +++ /dev/null @@ -1,2 +0,0 @@ -.\premake5.exe parseunicode -pause diff --git a/build/Package_AutoDetect.bat b/build/Package_AutoDetect.bat deleted file mode 100644 index f86a8c6e5..000000000 --- a/build/Package_AutoDetect.bat +++ /dev/null @@ -1,2 +0,0 @@ -.\premake5.exe package -pause diff --git a/build/Package_MSVC.bat b/build/Package_MSVC.bat deleted file mode 100644 index c39f1cd6c..000000000 --- a/build/Package_MSVC.bat +++ /dev/null @@ -1,2 +0,0 @@ -.\premake5.exe --pack-libdir=msvc package -pause diff --git a/build/Package_MinGW.bat b/build/Package_MinGW.bat deleted file mode 100644 index 21d4c01fc..000000000 --- a/build/Package_MinGW.bat +++ /dev/null @@ -1,2 +0,0 @@ -.\premake5.exe --pack-libdir=mingw package -pause diff --git a/build/config.lua.default b/build/config.lua.default deleted file mode 100644 index b30566fcb..000000000 --- a/build/config.lua.default +++ /dev/null @@ -1,41 +0,0 @@ --- This file contains special configurations values, such as directories to extern libraries (Qt) --- Editing this file is not required to use/compile the engine, as default values should be enough - --- Additionnal compilation options ---AdditionalCompilationOptions = "-fsanitize=address" -- Enable ASan - --- Builds Nazara extern libraries (such as lua/STB) -BuildDependencies = true - --- Builds Nazara examples -BuildExamples = true - --- Setup configurations array (valid values: Debug, Release, ReleaseWithDebug) -Configurations = "Debug,Release,ReleaseWithDebug" -- "Debug,Release,ReleaseWithDebug" - --- Setup additionnals install directories, separated by a semi-colon ; (library binaries will be copied there) ---InstallDir = "/usr/local/lib64" - --- Adds a project which will recall premake with its original arguments when built (only works on Windows for now) -PremakeProject = false - --- Excludes client-only modules/tools/examples -ServerMode = false - --- Builds modules as one united library (useless on POSIX systems) -UniteModules = false - --- Qt5 directories (required for ShaderNodes editor) ---Qt5IncludeDir = [[C:\Projets\Libs\Qt\5.15.0\msvc2019\include]] ---Qt5BinDir_x86 = [[C:\Projets\Libs\Qt\5.15.0\msvc2019\bin]] ---Qt5BinDir_x64 = [[C:\Projets\Libs\Qt\5.15.0\msvc2019_64\bin]] ---Qt5LibDir_x86 = [[C:\Projets\Libs\Qt\5.15.0\msvc2019\lib]] ---Qt5LibDir_x64 = [[C:\Projets\Libs\Qt\5.15.0\msvc2019_64\lib]] - - --- QtNodes directories (required for ShaderNodes editor) ---QtNodesIncludeDir = [[C:\Projets\Libs\nodeeditor\include]] ---QtNodesBinDir_x86 = [[C:\Projets\Libs\nodeeditor\build32\bin\Release]] ---QtNodesBinDir_x64 = [[C:\Projets\Libs\nodeeditor\build64\bin\Release]] ---QtNodesLibDir_x86 = [[C:\Projets\Libs\nodeeditor\build32\lib\Release]] ---QtNodesLibDir_x64 = [[C:\Projets\Libs\nodeeditor\build64\lib\Release]] \ No newline at end of file diff --git a/build/scripts/actions/codeblocks.lua b/build/scripts/actions/codeblocks.lua deleted file mode 100644 index f96a6d591..000000000 --- a/build/scripts/actions/codeblocks.lua +++ /dev/null @@ -1,4 +0,0 @@ -dofile("codeblocks/_codeblocks.lua") -dofile("codeblocks/codeblocks.lua") - -ACTION.Manual = true diff --git a/build/scripts/actions/codeblocks/_codeblocks.lua b/build/scripts/actions/codeblocks/_codeblocks.lua deleted file mode 100644 index 6a52bc404..000000000 --- a/build/scripts/actions/codeblocks/_codeblocks.lua +++ /dev/null @@ -1,44 +0,0 @@ --- --- _codeblocks.lua --- Define the Code::Blocks action(s). --- Copyright (c) 2002-2011 Jason Perkins and the Premake project --- - local p = premake - - p.modules.codeblocks = {} - p.modules.codeblocks._VERSION = p._VERSION - - local codeblocks = p.modules.codeblocks - - newaction { - trigger = "codeblocks", - shortname = "Code::Blocks", - description = "Generate Code::Blocks project files", - - valid_kinds = { "ConsoleApp", "WindowedApp", "StaticLib", "SharedLib" }, - - valid_languages = { "C", "C++" }, - - valid_tools = { - cc = { "clang", "gcc", "ow" }, - }, - - onWorkspace = function(wks) - p.modules.codeblocks.generateWorkspace(wks) - end, - - onProject = function(prj) - p.modules.codeblocks.generateProject(prj) - end, - - onCleanWorkspace = function(wks) - p.clean.file(wks, wks.name .. ".workspace") - p.clean.file(wks, wks.name .. ".workspace.layout") - end, - - onCleanProject = function(prj) - p.clean.file(prj, prj.name .. ".workspace") - p.clean.file(prj, prj.name .. ".depend") - p.clean.file(prj, prj.name .. ".layout") - end - } diff --git a/build/scripts/actions/codeblocks/codeblocks.lua b/build/scripts/actions/codeblocks/codeblocks.lua deleted file mode 100644 index ebd8d11fa..000000000 --- a/build/scripts/actions/codeblocks/codeblocks.lua +++ /dev/null @@ -1,67 +0,0 @@ --- --- codeblocks_workspace.lua --- Generate a Code::Blocks workspace. --- Copyright (c) 2009 Jason Perkins and the Premake project --- - - local p = premake - - p.modules.codeblocks = {} - p.modules.codeblocks._VERSION = p._VERSION - - local codeblocks = p.modules.codeblocks - local project = p.project - - - function codeblocks.cfgname(cfg) - local cfgname = cfg.buildcfg - if codeblocks.workspace.multiplePlatforms then - cfgname = string.format("%s|%s", cfg.platform, cfg.buildcfg) - end - return cfgname - end - - function codeblocks.esc(value) - local result = value:gsub('"', '"') - result = result:gsub('<', '<') - result = result:gsub('>', '>') - return result - end - - function codeblocks.generateWorkspace(wks) - p.eol("\r\n") - p.indent("\t") - p.escaper(codeblocks.esc) - - p.generate(wks, ".workspace", codeblocks.workspace.generate) - end - - function codeblocks.generateProject(prj) - p.eol("\r\n") - p.indent("\t") - p.escaper(codeblocks.esc) - - if project.iscpp(prj) then - p.generate(prj, ".cbp", codeblocks.project.generate) - end - end - - function codeblocks.cleanWorkspace(wks) - p.clean.file(wks, wks.name .. ".workspace") - p.clean.file(wks, wks.name .. ".workspace.layout") - end - - function codeblocks.cleanProject(prj) - p.clean.file(prj, prj.name .. ".workspace") - p.clean.file(prj, prj.name .. ".depend") - p.clean.file(prj, prj.name .. ".layout") - end - - function codeblocks.cleanTarget(prj) - -- TODO.. - end - - include("codeblocks_workspace.lua") - include("codeblocks_project.lua") - - diff --git a/build/scripts/actions/codeblocks/codeblocks_project.lua b/build/scripts/actions/codeblocks/codeblocks_project.lua deleted file mode 100644 index acfede4c2..000000000 --- a/build/scripts/actions/codeblocks/codeblocks_project.lua +++ /dev/null @@ -1,243 +0,0 @@ --- --- codeblocks_cbp.lua --- Generate a Code::Blocks C/C++ project. --- Copyright (c) 2009, 2011 Jason Perkins and the Premake project --- - - local p = premake - local project = p.project - local config = p.config - local tree = p.tree - local codeblocks = p.modules.codeblocks - - codeblocks.project = {} - local m = codeblocks.project - m.elements = {} - - m.ctools = { - gcc = "gcc", - msc = "Visual C++", - } - - function m.getcompilername(cfg) - local tool = _OPTIONS.cc or cfg.toolset or p.GCC - - local toolset = p.tools[tool] - if not toolset then - error("Invalid toolset '" + (_OPTIONS.cc or cfg.toolset) + "'") - end - - return m.ctools[tool] - end - - function m.getcompiler(cfg) - local toolset = p.tools[_OPTIONS.cc or cfg.toolset or p.GCC] - if not toolset then - error("Invalid toolset '" + (_OPTIONS.cc or cfg.toolset) + "'") - end - return toolset - end - - function m.header(prj) - _p('') - _p('') - _p(1,'') - - -- write project block header - _p(1,'') - _p(2,'') - _p('') - end - - m.elements.project = function(prj) - return { - m.header, - m.configurations, - m.files, - m.extensions, - m.footer - } - end - --- --- Project: Generate the CodeBlocks project file. --- - function m.generate(prj) - p.utf8() - - p.callArray(m.elements.project, prj) - end - - function m.configurations(prj) - -- write configuration blocks - _p(2,'') - local platforms = {} - for cfg in project.eachconfig(prj) do - local found = false - for k,v in pairs(platforms) do - if (v.platform == cfg.platform) then - table.insert(v.configs, cfg) - found = true - break - end - end - - if (not found) then - table.insert(platforms, {platform = cfg.platform, configs = {cfg}}) - end - end - - for k,platform in pairs(platforms) do - for k,cfg in pairs(platform.configs) do - local compiler = m.getcompiler(cfg) - - _p(3,'', cfg.longname) - - _p(4,'') - end - end - _p(2,'') - end - --- --- Write out a list of the source code files in the project. --- - - function m.files(prj) - local pchheader - if (prj.pchheader) then - pchheader = path.getrelative(prj.location, prj.pchheader) - end - - local tr = project.getsourcetree(prj) - tree.traverse(tr, { - -- source files are handled at the leaves - onleaf = function(node, depth) - if node.relpath == node.vpath then - _p(2,'', node.relpath) - else - _p(2,'', node.name) - _p(3,'') - - end, - }, false, 1) - end - - function m.extensions(prj) - for cfg in project.eachconfig(prj) do - if cfg.debugenvs and #cfg.debugenvs > 0 then - --Assumption: if gcc is being used then so is gdb although this section will be ignored by - --other debuggers. If using gcc and not gdb it will silently not pass the - --environment arguments to the debugger - if m.getcompilername(cfg) == "gcc" then - _p(3,'') - _p(4,'', p.esc(cfg.longname)) - local args = '' - local sz = #cfg.debugenvs - for idx, v in ipairs(cfg.debugenvs) do - args = args .. 'set env ' .. v - if sz ~= idx then args = args .. ' ' end - end - _p(5,'',args) - _p(4,'') - _p(3,'') - else - error('Sorry at this moment there is no support for debug environment variables with this debugger and codeblocks') - end - end - end - end diff --git a/build/scripts/actions/codeblocks/codeblocks_workspace.lua b/build/scripts/actions/codeblocks/codeblocks_workspace.lua deleted file mode 100644 index 3de935877..000000000 --- a/build/scripts/actions/codeblocks/codeblocks_workspace.lua +++ /dev/null @@ -1,44 +0,0 @@ --- --- Name: codelite/codelite_workspace.lua --- Purpose: Generate a CodeLite workspace. --- Author: Ryan Pusztai --- Modified by: Andrea Zanellato --- Manu Evans --- Created: 2013/05/06 --- Copyright: (c) 2008-2015 Jason Perkins and the Premake project --- - - local p = premake - local project = p.project - local workspace = p.workspace - local tree = p.tree - local codeblocks = p.modules.codeblocks - - codeblocks.workspace = {} - local m = codeblocks.workspace - --- --- Generate a CodeBlocks workspace --- - function m.generate(wks) - p.utf8() - - _p('') - _p('') - _p(1,'', wks.name) - - for prj in workspace.eachproject(wks) do - local fname = path.join(path.getrelative(wks.location, prj.location), prj.name) - local active = iif(prj.project == wks.projects[1], ' active="1"', '') - - _p(2,'', fname, active) - for _,dep in ipairs(project.getdependencies(prj)) do - _p(3,'', path.join(path.getrelative(wks.location, dep.location), dep.name)) - end - - _p(2,'') - end - - _p(1,'') - _p('') - end \ No newline at end of file diff --git a/build/scripts/actions/encodesresources.lua b/build/scripts/actions/encodesresources.lua deleted file mode 100644 index f508c5c69..000000000 --- a/build/scripts/actions/encodesresources.lua +++ /dev/null @@ -1,49 +0,0 @@ -ACTION.Name = "EncodeResources" -ACTION.Description = "Generate a includable header version of resources" - -ACTION.Function = function () - print("Encoding resources ...") - local startClock = os.clock() - local modules = os.matchdirs("../src/Nazara/*") - table.insert(modules, "../SDK/src/NDK") - for k, modulePath in pairs(modules) do - local moduleName - if (modulePath:sub(4, 6) == "src") then - moduleName = modulePath:sub(15, -1) - else - moduleName = "SDK" - end - local files = os.matchfiles(modulePath .. "/Resources/**") - for k, filePath in pairs(files) do - if (filePath:sub(-2) ~= ".h") then - local file = filePath:sub(modulePath:len() + 12, -1) - local resource, err = io.open(filePath, "rb") - if (not resource) then - error("Failed to read resource file " .. file .. ": " .. err) - end - - local resourceContent = resource:read("*a") - resource:close() - - local contentLength = resourceContent:len() - - local headerContentTable = {} - for i = 1, contentLength do - table.insert(headerContentTable, string.format("%d,", resourceContent:byte(i))) - end - local headerContent = table.concat(headerContentTable) - - local header, err = io.open(filePath .. ".h", "w+") - if (not header) then - error("Failed to create header file for " .. file .. ": " .. err) - end - - header:write(headerContent) - header:close() - - print(string.format("%s: %s (raw: %.3g kB, header: %.3g kB)", moduleName, file, contentLength/1024, string.format("%.3g", headerContent:len()/1024))) - end - end - end - print("Finished (took " .. os.clock() - startClock .. "s)") -end diff --git a/build/scripts/actions/generatefeatures.lua b/build/scripts/actions/generatefeatures.lua deleted file mode 100644 index 50c3f6334..000000000 --- a/build/scripts/actions/generatefeatures.lua +++ /dev/null @@ -1,237 +0,0 @@ -function PrintTable ( t, indent, done ) - done = done or {} - indent = indent or 0 - - local txt = {} - for key, value in pairs (t) do - table.insert(txt, string.rep (" ", indent)) - if (type(value) == "table" and not done[value]) then - done [value] = true - table.insert(txt, tostring(key) .. ":" .. "\n") - table.insert(txt, PrintTable (value, indent + 2, done)) - else - table.insert(txt, tostring (key) .. "\t=\t" ) - table.insert(txt, tostring(value) .. "\n" ) - end - end - - return table.concat(txt) -end - -Feature = {} - --- Tables de vérité -local andTable = -{ - {0,0}, - {0,1}, -} -local orTable = -{ - {0,1}, - {1,1}, -} - -local xorTable = -{ - {0,1}, - {1,0}, -} - -local bitFunc = function (a, b, truthTable) - local power = 1 - local c = 0 - while (a > 0 or b > 0) do - c = c + (truthTable[(a % 2)+1][(b % 2)+1] * power) - a = math.floor(a/2) - b = math.floor(b/2) - power = power * 2 - end - - return c -end - -function Feature.AND(a, b) - return bitFunc(a, b, andTable) -end - -function Feature.OR(a, b) - return bitFunc(a, b, orTable) -end - -function Feature.XOR(a, b) - return bitFunc(a, b, xorTable) -end - -Feature.NotApplicable = 0 -Feature.Windows = 2 ^ 0 -Feature.Linux = 2 ^ 1 -Feature.MacOSX = 2 ^ 2 -Feature.RaspberryPi = 2 ^ 3 -Feature.POSIX = Feature.Linux + Feature.MacOSX + Feature.RaspberryPi - -function Feature.CompleteData(tab, requiredPortability) - if (not requiredPortability) then - assert(tab.RequiredPortability) - requiredPortability = tab.RequiredPortability - elseif (tab.RequiredPortability) then - requiredPortability = Feature.OR(requiredPortability, tab.RequiredPortability) - end - - tab.RequiredPortability = requiredPortability - - if (not tab.Portability) then - tab.Portability = Feature.NotApplicable - end - - if (tab.Features) then - local acc = 0 - for k,v in pairs(tab.Features) do - if (type(v) == "string") then - v = {Title = v} - tab.Features[k] = v - end - - Feature.CompleteData(v, requiredPortability) - - v.Progress = v.Progress or 100 - - acc = acc + v.Progress - end - - tab.Progress = acc/#tab.Features - end -end - -function Feature.Generate() - local files = os.matchfiles("scripts/features/*.lua") - - local modules = {} - - for k, filePath in pairs(files) do - local moduleName = filePath:match(".*/(.*).lua") - - local data = dofile(filePath) - Feature.CompleteData(data) - - modules[moduleName] = data - end - - local content = {} - - local contentType = - { - ["(%s*)%%MODULELIST%%"] = Feature.GenerateModuleList, - ["(%s*)%%MODULEDESCRIPTION%%"] = Feature.GenerateModuleDescriptions, - ["(%s*)%%DATE%%"] = function (dontcare, space, content) - table.insert(content, string.format("%s%s", space, os.date("%d/%m/%Y"))) - end, - } - - local index = io.open("scripts/features/index_template.html") - for line in index:lines() do - local matched = false - for k,v in pairs(contentType) do - local space = line:match(k) - if (space) then - matched = true - v(modules, space, content) - break - end - end - - if (not matched) then - table.insert(content, line) - end - end - - io.open("scripts/features/index.html", "w+"):write(table.concat(content, "\n")) -end - -function Feature.Interpolate(from, to, p) - return from + (to - from)*p -end - -function Feature.ComputeColor(progress) - local stable = {0, 200, 0} - local partial = {255, 127, 0} - local unusable = {255, 0, 0} - - local a, b, p - if (progress < 20) then - a = unusable - b = partial - p = progress/20.0 - else - a = partial - b = stable - p = math.min(20 * 1.020321705^(progress - 20), 100.0)/100.0 -- Je me complique certainement la vie pour ce qui est d'avoir une interpolation exponentielle, mais ça remonte tout ça ... - end - - local color = {nil, nil, nil} - for i = 1, 3 do - color[i] = Feature.Interpolate(a[i], b[i], p) - end - - return color -end - -function Feature.GenerateModuleList(modules, space, content) - for k,v in pairs(modules) do - local c = Feature.ComputeColor(v.Progress) - - table.insert(content, string.format([[%s]], space)) - table.insert(content, string.format([[%s %s]], space, k, v.Title)) - table.insert(content, string.format([[%s %d%%]], space, c[1], c[2], c[3], v.Progress)) - table.insert(content, string.format([[%s]], space)) - end -end - -function Feature.GenerateModuleDescriptions(modules, space, content) - for k,v in pairs(modules) do - table.insert(content, string.format([[%s
]], space)) - table.insert(content, string.format([[%s
]], space, k, v.Title)) - table.insert(content, string.format([[%s %s (%s) : %d%%]], space, k, v.Title, v.LibName, math.floor(v.Progress))) - - table.insert(content, string.format([[%s

Fonctionnalités:

]], space)) - Feature.GenerateFeatureList(v.Features, space .. "\t\t", content) - - table.insert(content, string.format([[%s
]], space)) - end -end - -function Feature.GenerateFeatureList(featureTable, space, content) - table.insert(content, string.format("%s", space)) -end - -ACTION.Name = "GenerateFeatures" -ACTION.Description = "Generate a web page describing each module's feature" - -ACTION.Function = Feature.Generate diff --git a/build/scripts/actions/generateheaders.lua b/build/scripts/actions/generateheaders.lua deleted file mode 100644 index c8e90ebe0..000000000 --- a/build/scripts/actions/generateheaders.lua +++ /dev/null @@ -1,116 +0,0 @@ -ACTION.Name = "GenerateHeaders" -ACTION.Description = "Generate a global header for each module" - -ACTION.ModuleExcludes = {} -ACTION.ModuleExcludes["ConfigCheck.hpp"] = true -ACTION.ModuleExcludes["Debug.hpp"] = true -ACTION.ModuleExcludes["DebugOff.hpp"] = true -ACTION.ModuleExcludes["ThreadSafety.hpp"] = true -ACTION.ModuleExcludes["ThreadSafetyOff.hpp"] = true - -local action = ACTION -ACTION.Function = function () - local paths = {} - - local modules = os.matchdirs("../include/Nazara/*") - for k, modulePath in pairs(modules) do - local moduleName = modulePath:match(".*/(.*)") - - local config, err = io.open(modulePath .. "/Config.hpp", "r") - local head = "" - if (not config) then - error("Failed to read config file: " .. err) - end - - for line in config:lines() do - if (line == "#pragma once") then -- Stop before including the #pragma once as it's already written automatically - break - end - head = head .. line .. "\n" - end - - config:close() - - table.insert(paths, { - Excludes = action.ModuleExcludes, - Header = head, - HeaderGuard = "NAZARA_GLOBAL_" .. moduleName:upper() .. "_HPP", - Name = "Nazara" .. moduleName, - SearchDir = modulePath, - Target = modulePath .. ".hpp", - TopDir = "Nazara" - }) - end - - table.insert(paths, { - Excludes = { - ["DeviceFunctions.hpp"] = true, - ["GlobalFunctions.hpp"] = true, - ["InstanceFunctions.hpp"] = true, - }, - HeaderGuard = "NAZARA_GLOBAL_VULKANRENDERER_WRAPPER_HPP", - Name = "Vulkan wrapper", - SearchDir = "../include/Nazara/VulkanRenderer/Wrapper", - TopDir = "Nazara", - Target = "../include/Nazara/VulkanRenderer/Wrapper.hpp" - }) - - table.insert(paths, { - Excludes = {}, - HeaderGuard = "NDK_COMPONENTS_GLOBAL_HPP", - Name = "NDK Components", - SearchDir = "../SDK/include/NDK/Components", - TopDir = "NDK", - Target = "../SDK/include/NDK/Components.hpp" - }) - - table.insert(paths, { - Excludes = {}, - HeaderGuard = "NDK_SYSTEMS_GLOBAL_HPP", - Name = "NDK Systems", - SearchDir = "../SDK/include/NDK/Systems", - TopDir = "NDK", - Target = "../SDK/include/NDK/Systems.hpp" - }) - - table.insert(paths, { - Excludes = {}, - HeaderGuard = "NDK_WIDGETS_GLOBAL_HPP", - Name = "NDK Widgets", - SearchDir = "../SDK/include/NDK/Widgets", - TopDir = "NDK", - Target = "../SDK/include/NDK/Widgets.hpp" - }) - - for k,v in ipairs(paths) do - print(v.Name) - local header, err = io.open(v.Target, "w+") - if (not header) then - error("Failed to create header file (" .. v.Target .. "): " .. err) - end - - header:write("// This file was automatically generated\n\n") - if (v.Header) then - header:write(v.Header) - end - - header:write("#pragma once\n\n") - header:write("#ifndef " .. v.HeaderGuard .. "\n") - header:write("#define " .. v.HeaderGuard .. "\n\n") - - local files = os.matchfiles(v.SearchDir .. "/*.hpp") - local count = 0 - for k, filePath in pairs(files) do - local include, fileName = filePath:match(".*(" .. v.TopDir .. "/.*/(.*))") - if (not v.Excludes[fileName]) then - header:write("#include <" .. include .. ">\n") - count = count + 1 - end - end - - header:write("\n#endif // " .. v.HeaderGuard .. "\n") - header:close() - - print(string.format("-#include count: %d", count)) - end -end diff --git a/build/scripts/actions/package.lua b/build/scripts/actions/package.lua deleted file mode 100644 index f263f8faf..000000000 --- a/build/scripts/actions/package.lua +++ /dev/null @@ -1,200 +0,0 @@ -newoption({ - trigger = "pack-libdir", - description = "Specifies the subdirectory in lib/ to be used when packaging the project" -}) - -ACTION.Name = "Package" -ACTION.Description = "Pack Nazara binaries/include/lib together" - -ACTION.Function = function () - local libDir = _OPTIONS["pack-libdir"] - if (not libDir or #libDir == 0) then - local libDirs = os.matchdirs("../lib/*") - if (#libDirs > 1) then - error("More than one subdirectory was found in the lib directory, please use the --pack-libdir command to clarify which directory should be used") - elseif (#libDirs == 0) then - error("No subdirectory was found in the lib directory, have you built the engine yet?") - else - libDir = path.getname(libDirs[1]) - print("No directory was set by the --pack-libdir command, \"" .. libDir .. "\" will be used") - end - end - - local realLibDir = "../lib/" .. libDir .. "/" - if (not os.isdir(realLibDir)) then - error(string.format("\"%s\" doesn't seem to be an existing directory", realLibDir)) - end - - local archEnabled = { - ["x64"] = false, - ["x86"] = false - } - - local enabledArchs = {} - for k,v in pairs(os.matchdirs(realLibDir .. "*")) do - local arch = path.getname(v) - if (archEnabled[arch] ~= nil) then - archEnabled[arch] = true - table.insert(enabledArchs, arch) - else - print("Unknown directory " .. v .. " found, ignored") - end - end - enabledArchs = table.concat(enabledArchs, ", ") - print(enabledArchs .. " arch found") - - local packageDir = "../package/" - - local copyTargets = { - { -- Engine headers - Masks = {"**.hpp", "**.inl"}, - Source = "../include/", - Target = "include/" - }, - { -- SDK headers - Masks = {"**.hpp", "**.inl"}, - Source = "../SDK/include/", - Target = "include/" - }, - { -- Examples files - Masks = {"**.hpp", "**.inl", "**.cpp"}, - Source = "../examples/", - Target = "examples/" - }, - { -- Demo resources - Masks = {"**.*"}, - Source = "../examples/bin/resources/", - Target = "examples/bin/resources/" - }, - -- Unit test sources - { - Masks = {"**.hpp", "**.inl", "**.cpp"}, - Source = "../tests/", - Target = "tests/src/" - }, - -- Unit test resources - { - Masks = {"**.*"}, - Source = "../tests/resources/", - Target = "tests/resources/" - } - } - - local binFileMasks - local libFileMasks - local exeFileExt - local exeFilterFunc - if (os.ishost("windows")) then - binFileMasks = {"**.dll", "**.pdb"} - libFileMasks = {"**.lib", "**.a"} - exeFileExt = ".exe" - exeFilterFunc = function (filePath) return true end - else - if (os.ishost("macosx")) then - binFileMasks = {"**.dynlib"} - else - binFileMasks = {"**.so"} - end - - libFileMasks = {"**.a"} - exeFileExt = "" - exeFilterFunc = function (filePath) return path.getextension(filePath):contains('/') end - end - - for arch, enabled in pairs(archEnabled) do - if (enabled) then - local archLibSrc = realLibDir .. arch .. "/" - local arch3rdPartyBinSrc = "../thirdparty/lib/common/" .. arch .. "/" - local archBinDst = "bin/" .. arch .. "/" - local archLibDst = "lib/" .. arch .. "/" - - -- Engine/SDK binaries - table.insert(copyTargets, { - Masks = binFileMasks, - Source = archLibSrc, - Target = archBinDst - }) - - -- Engine/SDK libraries - table.insert(copyTargets, { - Masks = libFileMasks, - Source = archLibSrc, - Target = archLibDst - }) - - -- 3rd party binary dep - table.insert(copyTargets, { - Masks = binFileMasks, - Source = arch3rdPartyBinSrc, - Target = archBinDst - }) - end - end - - -- Demo executable - table.insert(copyTargets, { - Masks = {"Demo*" .. exeFileExt}, - Filter = exeFilterFunc, - Source = "../examples/bin/", - Target = "examples/bin/" - }) - - -- Unit test - table.insert(copyTargets, { - Masks = {"*" .. exeFileExt}, - Filter = exeFilterFunc, - Source = "../tests/", - Target = "tests/" - }) - - -- Processing - os.mkdir(packageDir) - - local size = 0 - for k,v in pairs(copyTargets) do - local target = packageDir .. v.Target - local includePrefix = v.Source - - local targetFiles = {} - for k, mask in pairs(v.Masks) do - print(includePrefix .. mask .. " => " .. target) - local files = os.matchfiles(includePrefix .. mask) - if (v.Filter) then - for k,path in pairs(files) do - if (not v.Filter(path)) then - files[k] = nil - end - end - end - - targetFiles = table.join(targetFiles, files) - end - - for k,v in pairs(targetFiles) do - local relPath = v:sub(#includePrefix + 1) - - local targetPath = target .. relPath - local targetDir = path.getdirectory(targetPath) - - if (not os.isdir(targetDir)) then - local ok, err = os.mkdir(targetDir) - if (not ok) then - print("Failed to create directory \"" .. targetDir .. "\": " .. err) - end - end - - local ok, err = os.copyfile(v, targetPath) - if (not ok) then - print("Failed to copy \"" .. v .. "\" to \"" .. targetPath .. "\": " .. err) - end - - local stat = os.stat(targetPath) - if (stat) then - size = size + stat.size - end - end - end - - local config = libDir .. " - " .. enabledArchs - print(string.format("Package successfully created at \"%s\" (%u MB, %s)", packageDir, size // (1024 * 1024), config)) -end diff --git a/build/scripts/actions/spirv.lua b/build/scripts/actions/spirv.lua deleted file mode 100644 index 432acc0d0..000000000 --- a/build/scripts/actions/spirv.lua +++ /dev/null @@ -1,271 +0,0 @@ -ACTION.Name = "UpdateSpirV" -ACTION.Description = "Download and parse the SpirV grammar and generate a .cpp file for it" - -local spirvGrammarURI = "https://raw.githubusercontent.com/KhronosGroup/SPIRV-Headers/master/include/spirv/unified1/spirv.core.grammar.json" - -ACTION.Function = function() - io.write("Downloading Spir-V grammar... ") - local content, resultStr, resultCode = http.get(spirvGrammarURI, { - headers = { "From: Premake", "Referer: Premake" } - }) - - if (resultCode ~= 200) then - error("Failed to download SpirV grammar: " .. resultStr) - end - - print("Done") - - io.write("Parsing... ") - - local result, err = json.decode(content) - assert(result, err) - - local instructions = {} - local instructionById = {} - for _, instruction in pairs(result.instructions) do - local duplicateId = instructionById[instruction.opcode] - if (duplicateId == nil) then - table.insert(instructions, instruction) - instructionById[instruction.opcode] = #instructions - else - instructions[duplicateId] = instruction - end - end - - local operands = {} - local operandByInstruction = {} - for _, instruction in pairs(instructions) do - if (instruction.operands) then - local resultId - local firstId = #operands - local operandCount = #instruction.operands - for i, operand in pairs(instruction.operands) do - table.insert(operands, operand) - - if (operand.kind == "IdResult") then - assert(not resultId, "unexpected operand with two IdResult") - resultId = i - 1 - end - end - - operandByInstruction[instruction.opcode] = { firstId = firstId, count = operandCount, resultId = resultId } - end - end - - print("Done") - - io.write("Generating... ") - - local headerFile = io.open("../include/Nazara/Shader/SpirvData.hpp", "w+") - assert(headerFile, "failed to open Spir-V header") - - headerFile:write([[ -// Copyright (C) ]] .. os.date("%Y") .. [[ Jérôme Leclercq -// This file is part of the "Nazara Engine - Shader generator" -// For conditions of distribution and use, see copyright notice in Config.hpp" - -// This file was generated automatically, please do not edit - -#pragma once - -#ifndef NAZARA_SPIRVDATA_HPP -#define NAZARA_SPIRVDATA_HPP - -#include -#include -#include - -namespace Nz -{ -]]) - - headerFile:write([[ - constexpr UInt32 SpirvMagicNumber = ]] .. result.magic_number .. [[; - constexpr UInt32 SpirvMajorVersion = ]] .. result.major_version .. [[; - constexpr UInt32 SpirvMinorVersion = ]] .. result.minor_version .. [[; - constexpr UInt32 SpirvRevision = ]] .. result.revision .. [[; - constexpr UInt32 SpirvVersion = (SpirvMajorVersion << 16) | (SpirvMinorVersion << 8); - -]]) - - -- SpirV operations - headerFile:write([[ - enum class SpirvOp - { -]]) - - for _, instruction in pairs(result.instructions) do - headerFile:write("\t\t" .. instruction.opname .. " = " .. instruction.opcode .. ",\n") - end - -headerFile:write([[ - }; - -]]) - - -- SpirV operands - headerFile:write([[ - enum class SpirvOperandKind - { -]]) - - for _, operand in pairs(result.operand_kinds) do - headerFile:write("\t\t" .. operand.kind .. ",\n") - end - - headerFile:write([[ - }; - -]]) - - -- SpirV enums - for _, operand in pairs(result.operand_kinds) do - if (operand.category == "ValueEnum" or operand.category == "BitEnum") then - local enumName = "Spirv" .. operand.kind - headerFile:write([[ - enum class ]] .. enumName .. [[ - - { -]]) - - local maxName - local maxValue - for _, enumerant in pairs(operand.enumerants) do - local value = enumerant.value - - local eName = enumerant.enumerant:match("^%d") and operand.kind .. enumerant.enumerant or enumerant.enumerant - headerFile:write([[ - ]] .. eName .. [[ = ]] .. value .. [[, -]]) - - if (not maxValue or value > maxValue) then - maxName = eName - end - end - - headerFile:write([[ - }; - -]]) - if (operand.category == "BitEnum") then - headerFile:write([[ - template<> - struct EnumAsFlags<]] .. enumName .. [[> - { - static constexpr ]] .. enumName .. [[ max = ]] .. enumName .. "::" .. maxName .. [[; - - static constexpr bool AutoFlag = false; - }; - - -]]) - end - end - end - - -- Struct - headerFile:write([[ - struct SpirvInstruction - { - struct Operand - { - SpirvOperandKind kind; - const char* name; - }; - - SpirvOp op; - const char* name; - const Operand* operands; - const Operand* resultOperand; - std::size_t minOperandCount; - }; - -]]) - - -- Functions signatures - headerFile:write([[ - NAZARA_SHADER_API const SpirvInstruction* GetInstructionData(UInt16 op); -]]) - -headerFile:write([[ -} - -#endif -]]) - - local sourceFile = io.open("../src/Nazara/Shader/SpirvData.cpp", "w+") - assert(sourceFile, "failed to open Spir-V source") - - sourceFile:write([[ -// Copyright (C) ]] .. os.date("%Y") .. [[ Jérôme Leclercq -// This file is part of the "Nazara Engine - Shader generator" -// For conditions of distribution and use, see copyright notice in Config.hpp" - -// This file was generated automatically, please do not edit - -#include -#include -#include -#include - -namespace Nz -{ - static constexpr std::array s_operands = { - { -]]) - for _, operand in pairs(operands) do - sourceFile:write([[ - { - SpirvOperandKind::]] .. operand.kind .. [[, - R"(]] .. (operand.name or operand.kind) .. [[)" - }, -]]) - end - - sourceFile:write([[ - } - }; - - static std::array s_instructions = { - { -]]) - - for _, instruction in pairs(instructions) do - local opByInstruction = operandByInstruction[instruction.opcode] - local resultId = opByInstruction and opByInstruction.resultId or nil - - sourceFile:write([[ - { - SpirvOp::]] .. instruction.opname .. [[, - R"(]] .. instruction.opname .. [[)", - ]] .. (opByInstruction and "&s_operands[" .. opByInstruction.firstId .. "]" or "nullptr") .. [[, - ]] .. (resultId and "&s_operands[" .. opByInstruction.firstId + resultId .. "]" or "nullptr") .. [[, - ]] .. (opByInstruction and opByInstruction.count or "0") .. [[, - }, -]]) - end - - sourceFile:write([[ - } - }; - -]]) - - -- Operand to string - sourceFile:write([[ - const SpirvInstruction* GetInstructionData(UInt16 op) - { - auto it = std::lower_bound(std::begin(s_instructions), std::end(s_instructions), op, [](const SpirvInstruction& inst, UInt16 op) { return UInt16(inst.op) < op; }); - if (it != std::end(s_instructions) && UInt16(it->op) == op) - return &*it; - else - return nullptr; - } -]]) - - sourceFile:write([[ -} -]]) - - print("Done") -end diff --git a/build/scripts/actions/unicode.lua b/build/scripts/actions/unicode.lua deleted file mode 100644 index 471c1808b..000000000 --- a/build/scripts/actions/unicode.lua +++ /dev/null @@ -1,265 +0,0 @@ -ACTION.Name = "ParseUnicode" -ACTION.Description = "Parse the Unicode Character Data and put the useful informations into a header" - -local CategoryToString = {} - CategoryToString["C"] = "Category_Other" - CategoryToString["Cc"] = "Category_Other_Control" - CategoryToString["Cf"] = "Category_Other_Format" - CategoryToString["Cn"] = "Category_Other_NotAssigned" - CategoryToString["Co"] = "Category_Other_PrivateUse" - CategoryToString["Cs"] = "Category_Other_Surrogate" - CategoryToString["L"] = "Category_Letter" - CategoryToString["Ll"] = "Category_Letter_Lowercase" - CategoryToString["Lm"] = "Category_Letter_Modifier" - CategoryToString["Lo"] = "Category_Letter_Other" - CategoryToString["Lt"] = "Category_Letter_Titlecase" - CategoryToString["Lu"] = "Category_Letter_Uppercase" - CategoryToString["M"] = "Category_Mark" - CategoryToString["Me"] = "Category_Mark_Enclosing" - CategoryToString["Mn"] = "Category_Mark_NonSpacing" - CategoryToString["Mc"] = "Category_Mark_SpacingCombining" - CategoryToString["N"] = "Category_Number" - CategoryToString["Nd"] = "Category_Number_DecimalDigit" - CategoryToString["Nl"] = "Category_Number_Letter" - CategoryToString["No"] = "Category_Number_Other" - CategoryToString["P"] = "Category_Punctuation" - CategoryToString["Pe"] = "Category_Punctuation_Close" - CategoryToString["Pc"] = "Category_Punctuation_Connector" - CategoryToString["Pd"] = "Category_Punctuation_Dash" - CategoryToString["Pf"] = "Category_Punctuation_FinalQuote" - CategoryToString["Pi"] = "Category_Punctuation_InitialQuote" - CategoryToString["Ps"] = "Category_Punctuation_Open" - CategoryToString["Po"] = "Category_Punctuation_Other" - CategoryToString["S"] = "Category_Symbol" - CategoryToString["Sc"] = "Category_Symbol_Currency" - CategoryToString["Sm"] = "Category_Symbol_Math" - CategoryToString["Sk"] = "Category_Symbol_Modifier" - CategoryToString["So"] = "Category_Symbol_Other" - CategoryToString["Z"] = "Category_Separator" - CategoryToString["Zl"] = "Category_Separator_Line" - CategoryToString["Zp"] = "Category_Separator_Paragraph" - CategoryToString["Zs"] = "Category_Separator_Space" - -local DirectionToString = {} - DirectionToString["AL"] = "Direction_Arabic_Letter" - DirectionToString["AN"] = "Direction_Arabic_Number" - DirectionToString["BN"] = "Direction_Boundary_Neutral" - DirectionToString["CS"] = "Direction_Common_Separator" - DirectionToString["EN"] = "Direction_European_Number" - DirectionToString["ES"] = "Direction_European_Separator" - DirectionToString["ET"] = "Direction_European_Terminator" - DirectionToString["FSI"] = "Direction_First_Strong_Isolate" - DirectionToString["L"] = "Direction_Left_To_Right" - DirectionToString["LRE"] = "Direction_Left_To_Right_Embedding" - DirectionToString["LRI"] = "Direction_Left_To_Right_Isolate" - DirectionToString["LRO"] = "Direction_Left_To_Right_Override" - DirectionToString["NSM"] = "Direction_Nonspacing_Mark" - DirectionToString["ON"] = "Direction_Other_Neutral" - DirectionToString["B"] = "Direction_Paragraph_Separator" - DirectionToString["PDF"] = "Direction_Pop_Directional_Formatting" - DirectionToString["PDI"] = "Direction_Pop_Directional_Isolate" - DirectionToString["R"] = "Direction_Right_To_Left" - DirectionToString["RLE"] = "Direction_Right_To_Left_Embedding" - DirectionToString["RLI"] = "Direction_Right_To_Left_Isolate" - DirectionToString["RLO"] = "Direction_Right_To_Left_Override" - DirectionToString["S"] = "Direction_Segment_Separator" - DirectionToString["WS"] = "Direction_White_Space" - -table.maxn = table.maxn or function (tab) -- Compatibilité Lua 5.2 - local maxIndex = 0 - for k,v in pairs(tab) do - if (k > maxIndex) then - maxIndex = k - end - end -end - -local function getCharacter(tab, first, index) - local character = {} - character.Category = CategoryToString[tab[3]] or "Category_NoCategory" - character.Direction = DirectionToString[tab[5]] or error("Direction not recognized") - character.LowerCase = (string.len(tab[14]) ~= 0 and (tonumber(tab[14], 16)-first)) or index - character.UpperCase = (string.len(tab[13]) ~= 0 and (tonumber(tab[13], 16)-first)) or index - character.TitleCase = (string.len(tab[15]) ~= 0 and (tonumber(tab[15], 16)-first)) or character.UpperCase - - return character -end - -ACTION.Function = function () - local unicodeSet = {} - if (not os.isdir("scripts/data") and not os.mkdir("scripts/data")) then - print("Failed to create scripts/data folder") - end - - local filepath = "scripts/data/UnicodeData.txt" - - print("Downloading UnicodeData.txt...") - - local t1 = os.clock() - - local result_str, response_code = http.download("https://www.unicode.org/Public/UCD/latest/ucd/UnicodeData.txt", filepath, { - headers = { "From: Premake", "Referer: Premake" } - }) - - if (response_code ~= 200) then - error("Failed to download UnicodeData.txt") - end - - local fileInfo = os.stat(filepath) - - local t2 = os.clock() - - print(string.format("Download succeeded (%.3f MiB) in %fs (%d KiB/s)", fileInfo.size / (1024 * 1024), t2 - t1, math.floor((fileInfo.size / (t2 - t1)) / 1024))) - - file = io.open (filepath, "r") - if (not file) then - error("Unable to open Unicode Data file") - return - end - - local characters = {} - local characterSets = {} - local lowercaseCharacters = {} - local titlecaseCharacters = {} - local uppercaseCharacters = {} - local currentBlock - local currentBlockStartCodepoint - local lineIndex = 1 - - t1 = os.clock() - - print("Parsing UnicodeData.txt...") - for line in file:lines() do - local parts = line:explode(";") - - local codepoint = tonumber(parts[1], 16) - local characterName = parts[2] - local category = parts[3] - local direction = parts[5] - local uppercaseMapping = tonumber(parts[13], 16) - local lowercaseMapping = tonumber(parts[14], 16) - local titlecaseMapping = tonumber(parts[15], 16) - - local blockName, blockId = string.match(characterName, "<(.+), (%w+)>") - if (currentBlock) then - if (blockId ~= "Last") then - error("Parsing error: expected last block at line " .. lineIndex) - end - - print("Detected set " .. blockName .. " from codepoint " .. currentBlockStartCodepoint .. " to " .. codepoint) - - table.insert(characterSets, { - startCodepoint = currentBlockStartCodepoint, - endCodepoint = codepoint, - name = "<" .. blockName .. ">", - category = category, - direction = direction - }) - - currentBlock = nil - else - if (blockName) then - if (blockId ~= "First") then - error("Parsing error: expected first block at line " .. lineIndex) - end - - currentBlock = blockName - currentBlockStartCodepoint = codepoint - else - table.insert(characters, { - codepoint = codepoint, - name = characterName, - category = category, - direction = direction, - upper = uppercaseMapping, - lower = lowercaseMapping, - title = titlecaseMapping - }) - - if (lowercaseMapping) then - table.insert(lowercaseCharacters, {codepoint = codepoint, lower = lowercaseMapping}) - end - - if (titlecaseMapping) then - table.insert(titlecaseCharacters, {codepoint = codepoint, title = titlecaseMapping}) - end - - if (uppercaseMapping) then - table.insert(uppercaseCharacters, {codepoint = codepoint, upper = uppercaseMapping}) - end - end - end - - lineIndex = lineIndex + 1 - end - - t2 = os.clock() - - print("Parsed " .. #characters .. " characters in " .. (t2 - t1) .. " seconds") - - print("Writting Unicode Data to header...") - - file = io.open("../src/Nazara/Core/UnicodeData.hpp", "w+") - if (not file) then - error("Failed to open Unicode Data header") - return - end - - t1 = os.clock() - - file:write(string.format("UnicodeCharacter unicodeCharacters[%d] = {\n", #characters)) - - for _, data in pairs(characters) do - local category = CategoryToString[data.category] - if (not category) then - error("Unknown category " .. data.category .. " for character " .. data.codepoint) - end - - local direction = DirectionToString[data.direction] - if (not direction) then - error("Unknown direction " .. data.direction .. " for character " .. data.codepoint) - end - - file:write(string.format("\t{%d, Unicode::%s, Unicode::%s},\n", data.codepoint, category, direction)) - end - file:write("};\n\n") - - file:write(string.format("UnicodeSet unicodeSets[%d] = {\n", #characterSets)) - - for _, data in pairs(characterSets) do - local category = CategoryToString[data.category] - if (not category) then - error("Unknown category " .. data.category .. " for character " .. data.codepoint) - end - - local direction = DirectionToString[data.direction] - if (not direction) then - error("Unknown direction " .. data.direction .. " for character " .. data.codepoint) - end - - file:write(string.format("\t{%d, %d, {%d, Unicode::%s, Unicode::%s}},\n", data.startCodepoint, data.endCodepoint, data.startCodepoint, category, direction)) - end - file:write("};\n\n") - - file:write(string.format("UnicodeCharacterSimpleMapping unicodeLower[%d] = {\n", #lowercaseCharacters)) - for _, data in pairs(lowercaseCharacters) do - file:write(string.format("\t{%d, %d},\n", data.codepoint, data.lower)) - end - file:write("};\n\n") - - file:write(string.format("UnicodeCharacterSimpleMapping unicodeTitle[%d] = {\n", #titlecaseCharacters)) - for _, data in pairs(titlecaseCharacters) do - file:write(string.format("\t{%d, %d},\n", data.codepoint, data.title)) - end - file:write("};\n\n") - - file:write(string.format("UnicodeCharacterSimpleMapping unicodeUpper[%d] = {\n", #uppercaseCharacters)) - for _, data in pairs(uppercaseCharacters) do - file:write(string.format("\t{%d, %d},\n", data.codepoint, data.upper)) - end - file:write("};\n\n") - - file:close() - - print("Succeeded in " .. (os.clock() - t1) .. "sec.") -end diff --git a/build/scripts/common.lua b/build/scripts/common.lua deleted file mode 100644 index f191249f1..000000000 --- a/build/scripts/common.lua +++ /dev/null @@ -1,1235 +0,0 @@ -NazaraBuild = {} - --- I wish Premake had a way to know the compiler in advance -local clangGccActions = "action:" .. table.concat({"codeblocks", "codelite", "gmake*", "xcode3", "xcode4"}, " or ") - -function NazaraBuild:AddExecutablePath(path) - self.ExecutableDir[path] = true - - self:AddInstallPath(path) -end - -function NazaraBuild:AddInstallPath(path) - self.InstallDir[path] = true -end - -function NazaraBuild:FilterLibDirectory(prefix, func) - filter({"action:codeblocks or codelite or gmake*", "architecture:x86", "system:Windows"}) - func(prefix .. "mingw/x86") - - filter({"action:codeblocks or codelite or gmake*", "architecture:x86_64", "system:Windows"}) - func(prefix .. "mingw/x64") - - filter({"action:codeblocks or codelite or gmake*", "architecture:x86", "system:not Windows"}) - func(prefix .. "gmake/x86") - - filter({"action:codeblocks or codelite or gmake*", "architecture:x86_64", "system:not Windows"}) - func(prefix .. "gmake/x64") - - filter({"action:vs*", "architecture:x86"}) - func(prefix .. "msvc/x86") - - filter({"action:vs*", "architecture:x86_64"}) - func(prefix .. "msvc/x64") - - filter({"action:xcode3 or xcode4", "architecture:x86"}) - func(prefix .. "xcode/x86") - - filter({"action:xcode3 or xcode4", "architecture:x86_64"}) - func(prefix .. "xcode/x64") - - filter({}) -end - -function NazaraBuild:Execute() - if (_ACTION == nil) then -- If no action is specified, the user probably only wants to know how all of this works - return - end - - local platformData - if (os.is64bit()) then - platformData = {"x64", "x86"} - else - platformData = {"x86", "x64"} - end - - if (self.Actions[_ACTION] == nil) then - -- Start defining projects - workspace("NazaraEngine") - platforms(platformData) - - startproject "DemoFirstScene" - location(_ACTION) - - do - local linkTypes = {"Dynamic"} -- {"Static", "Dynamic"} - local configs = {} - for k,linkType in pairs(linkTypes) do - for k,config in pairs(self.Config["Configurations"]) do - table.insert(configs, config .. linkType) - end - end - - configurations(configs) - end - - if (self.Config["PremakeProject"] and os.ishost("windows")) then - group("_Premake") - - local commandLine = "premake5.exe " .. table.concat(_ARGV, ' ') - project("Regenerate premake") - kind("Utility") - prebuildcommands("cd .. && " .. commandLine) - end - - -- Extern libraries - if (self.Config["BuildDependencies"]) then - group("Thirdparties") - - for k, libTable in ipairs(self.OrderedExtLibs) do - project(libTable.Name) - - self:PreconfigGenericProject() - - language(libTable.Language) - location(_ACTION .. "/thirdparty") - - files(libTable.Files) - excludes(libTable.FilesExcluded) - - if (libTable.DisableWarnings) then - warnings("Off") - end - - defines(libTable.Defines) - flags(libTable.Flags) - kind("StaticLib") -- Force them as static libs - sysincludedirs("../thirdparty/include") - includedirs(libTable.Includes) - sysincludedirs(libTable.ExtIncludes) - links(libTable.Libraries) - libdirs("../thirdparty/lib/common") - - self:FilterLibDirectory("../thirdparty/genlib/", targetdir) -- For generated libraries - - filter(clangGccActions) - buildoptions("-U__STRICT_ANSI__") - - filter("architecture:x86") - libdirs(libTable.LibraryPaths.x86) - - filter("architecture:x86_64") - libdirs(libTable.LibraryPaths.x64) - - for k,v in pairs(libTable.ConfigurationLibraries) do - filter(k) - links(v) - end - - filter({}) - - if (libTable.Custom) then - libTable.Custom() - end - - self:PostconfigGenericProject() - end - end - - -- Modules - group("Engine Modules") - - if (_OPTIONS["united"]) then - project("NazaraEngine") - - self:PreconfigNazaraProject() - end - - for k, moduleTable in ipairs(self.OrderedModules) do - if (not _OPTIONS["united"]) then - project("Nazara" .. moduleTable.Name) - - self:PreconfigNazaraProject() - end - - location(_ACTION .. "/modules") - - includedirs({ - "../include", - "../src/" - }) - - sysincludedirs("../thirdparty/include", "/usr/local/include/") - - files(moduleTable.Files) - excludes(moduleTable.FilesExcluded) - - defines(moduleTable.Defines) - flags(moduleTable.Flags) - includedirs(moduleTable.Includes) - sysincludedirs(moduleTable.ExtIncludes) - links(moduleTable.Libraries) - - libdirs({ - "../thirdparty/lib/common", - "../lib" - }) - - if (os.ishost("macosx")) then - libdirs({ - "../thirdparty/lib/common", - "../lib", - "/usr/local/lib" --brew - }) - end - - -- Output to lib/conf/arch - self:FilterLibDirectory("../lib/", targetdir) - - -- Copy the module binaries to the example folder - self:MakeInstallCommands(moduleTable) - - filter("architecture:x86") - libdirs(moduleTable.LibraryPaths.x86) - - filter("architecture:x86_64") - libdirs(moduleTable.LibraryPaths.x64) - - for k,v in pairs(moduleTable.ConfigurationLibraries) do - filter(k) - links(v) - end - - filter({}) - - if (moduleTable.Custom) then - moduleTable.Custom() - end - - if (not _OPTIONS["united"]) then - self:PostconfigNazaraProject() - end - end - - if (_OPTIONS["united"]) then - self:PostconfigNazaraProject() - end - - -- Tools - group("Engine SDK - Tools") - - for k, toolTable in ipairs(self.OrderedTools) do - local prefix = "Nazara" - if (toolTable.Kind == "plugin") then - prefix = "Plugin" - end - - project(prefix .. toolTable.Name) - - self:PreconfigNazaraProject() - - location(_ACTION .. "/tools") - - if (toolTable.Kind == "plugin" or toolTable.Kind == "library") then - kind("SharedLib") - - -- Copy the tool binaries to the example folder - self:MakeInstallCommands(toolTable) - elseif (toolTable.Kind == "application") then - debugdir(toolTable.TargetDirectory) - targetdir(toolTable.TargetDirectory) - if (toolTable.EnableConsole) then - kind("ConsoleApp") - else - kind("WindowedApp") - end - else - assert(false, "Invalid tool kind") - end - - includedirs("../include") - sysincludedirs("../thirdparty/include") - - libdirs({ - "../thirdparty/lib/common", - "../lib" - }) - - files(toolTable.Files) - excludes(toolTable.FilesExcluded) - - defines(toolTable.Defines) - flags(toolTable.Flags) - includedirs(toolTable.Includes) - sysincludedirs(toolTable.ExtIncludes) - links(toolTable.Libraries) - - -- Output to lib/conf/arch - if (toolTable.Kind == "library") then - self:FilterLibDirectory(toolTable.TargetDirectory .. "/", targetdir) - elseif (toolTable.Kind == "plugin") then - self:FilterLibDirectory("../plugins/lib/", targetdir) - end - - filter("architecture:x86") - libdirs(toolTable.LibraryPaths.x86) - - filter("architecture:x86_64") - libdirs(toolTable.LibraryPaths.x64) - - for k,v in pairs(toolTable.ConfigurationLibraries) do - filter(k) - links(v) - end - - filter({}) - - self:PostconfigNazaraProject() - - if (toolTable.Custom) then - toolTable.Custom() - end - end - - group("Examples") - - for k, exampleTable in ipairs(self.OrderedExamples) do - local destPath = "../examples/bin" - - project("Demo" .. exampleTable.Name) - - self:PreconfigNazaraProject() - - location(_ACTION .. "/examples") - - if (exampleTable.Kind == "plugin" or exampleTable.Kind == "library") then - kind("SharedLib") - - self:MakeInstallCommands(toolTable) - elseif (exampleTable.Kind == "application") then - debugdir(exampleTable.TargetDirectory) - if (exampleTable.EnableConsole) then - kind("ConsoleApp") - else - kind("WindowedApp") - end - else - assert(false, "Invalid tool Kind") - end - - debugdir(destPath) - includedirs("../include") - includedirs(exampleTable.Includes) - sysincludedirs("../thirdparty/include") - sysincludedirs(exampleTable.ExtIncludes) - libdirs({ - "../lib", - exampleTable.LibDir - }) - - files(exampleTable.Files) - excludes(exampleTable.FilesExcluded) - - defines(exampleTable.Defines) - flags(exampleTable.Flags) - links(exampleTable.Libraries) - targetdir(destPath) - - for k,v in pairs(exampleTable.ConfigurationLibraries) do - filter(k) - links(v) - end - - filter({}) - - if (exampleTable.Custom) then - exampleTable.Custom() - end - - self:PostconfigNazaraProject() - end - end -end - -function NazaraBuild:GetConfig() - return self.Config -end - -function NazaraBuild:GetDependency(infoTable, name) - local projectName = name:match("Nazara(%w+)") - if (projectName) then - -- tool or module - local moduleTable = self.Modules[projectName:lower()] - if (moduleTable) then - return moduleTable - else - local toolTable = self.Tools[projectName:lower()] - if (toolTable) then - return toolTable - end - end - else - return self.ExtLibs[name:lower()] - end -end - -function NazaraBuild:Initialize() - self.Actions = {} - self.Examples = {} - self.ExecutableDir = {} - self.ExtLibs = {} - self.InstallDir = {} - self.Modules = {} - self.Tools = {} - - self.Config = {} - self:LoadConfig() - - -- Actions - modules = os.matchfiles("scripts/actions/*.lua") - for k,v in pairs(modules) do - local f, err = loadfile(v) - if (f) then - ACTION = {} - - f() - - local succeed, err = self:RegisterAction(ACTION) - if (not succeed) then - print("Unable to register action: " .. err) - end - else - print("Unable to load action file: " .. err) - end - end - ACTION = nil - - -- Extern libraries - local extlibs = os.matchfiles("../thirdparty/build/*.lua") - for k,v in pairs(extlibs) do - local f, err = loadfile(v) - if (f) then - LIBRARY = {} - self:SetupExtlibTable(LIBRARY) - - f() - - local succeed, err = self:RegisterExternLibrary(LIBRARY) - if (not succeed) then - print("Unable to register extern library: " .. err) - end - else - print("Unable to load extern library file: " .. err) - end - end - LIBRARY = nil - - -- Then the modules - local modules = os.matchfiles("scripts/modules/*.lua") - for k,v in pairs(modules) do - local moduleName = v:match(".*/(.*).lua") - local moduleNameLower = moduleName:lower() - - local f, err = loadfile(v) - if (f) then - MODULE = {} - self:SetupModuleTable(MODULE) - Config = self.Config - - f() - - local succeed, err = self:RegisterModule(MODULE) - if (not succeed) then - print("Unable to register module: " .. err) - end - else - print("Unable to load module file: " .. err) - end - end - MODULE = nil - - -- Continue with the tools (ex: SDK) - local tools = os.matchfiles("scripts/tools/*.lua") - for k,v in pairs(tools) do - local toolName = v:match(".*/(.*).lua") - local toolNameLower = toolName:lower() - - local f, err = loadfile(v) - if (f) then - TOOL = {} - self:SetupToolTable(TOOL) - - f() - - local succeed, err = self:RegisterTool(TOOL) - if (not succeed) then - print("Unable to register tool " .. tostring(TOOL.Name) .. ": " .. err) - end - else - print("Unable to load tool file " .. v .. ": " .. err) - end - end - TOOL = nil - - -- Examples - if (self.Config["BuildExamples"]) then - local examples = os.matchdirs("../examples/*") - for k,v in pairs(examples) do - local dirName = v:match(".*/(.*)") - if (dirName ~= "bin" and dirName ~= "build") then - local f, err = loadfile(v .. "/build.lua") - if (f) then - EXAMPLE = {} - EXAMPLE.Directory = dirName - self:SetupExampleTable(EXAMPLE) - - f() - - local succeed, err = self:RegisterExample(EXAMPLE) - if (not succeed) then - print("Unable to register example: " .. err) - end - else - print("Unable to load example file: " .. err) - end - end - end - EXAMPLE = nil - end - - -- Once everything is registred, let's process all the tables - self.OrderedExamples = {} - self.OrderedExtLibs = {} - self.OrderedModules = {} - self.OrderedTools = {} - local tables = {self.ExtLibs, self.Modules, self.Tools, self.Examples} - local orderedTables = {self.OrderedExtLibs, self.OrderedModules, self.OrderedTools, self.OrderedExamples} - for k,projects in ipairs(tables) do - -- Begin by resolving every project (because of dependencies in the same category) - for projectId,projectTable in pairs(projects) do - self:Resolve(projectTable) - end - - for projectId,projectTable in pairs(projects) do - if (self:Process(projectTable)) then - table.insert(orderedTables[k], projectTable) - else - print("Rejected " .. projectTable.Name .. " " .. string.lower(projectTable.Category) .. ": " .. projectTable.ExcludeReason) - end - end - - table.sort(orderedTables[k], function (a, b) return a.Name < b.Name end) - end -end - -function NazaraBuild:LoadConfigFile(path, configTable) - local f = io.open(path, "r") - if (f) then - local content = f:read("*a") - f:close() - - local func, err = load(content, "Config file", "t", configTable) - if (func) then - local status, err = pcall(func) - if (status) then - return true - else - print("Failed to load " .. path .. ": " .. err) - end - else - print("Failed to parse " .. path .. ": " .. err) - end - else - print("Failed to open " .. path) - end - - return false -end - -function NazaraBuild:LoadConfig() - if (not self:LoadConfigFile("config.lua", self.Config) and not self:LoadConfigFile("config.lua.default", self.Config)) then - error("Failed to load config file") - end - - local configTable = self.Config - local AddBoolOption = function (option, name, description) - newoption({ - trigger = name, - description = description - }) - - local str = _OPTIONS[name] - if (str) then - if (#str == 0 or str == "1" or str == "yes" or str == "true") then - configTable[option] = true - elseif (str == "0" or str == "no" or str == "false") then - configTable[option] = false - else - error("Invalid entry for " .. name .. " option: \"" .. str .. "\"") - end - end - end - - local AddStringOption = function (option, name, description) - newoption({ - trigger = name, - description = description - }) - - local str = _OPTIONS[name] - if (str) then - configTable[option] = str - end - end - - AddBoolOption("BuildDependencies", "with-extlibs", "Builds the extern libraries") - AddBoolOption("BuildExamples", "with-examples", "Builds the examples") - AddBoolOption("PremakeProject", "premakeproject", "Add a PremakeProject as a shortcut to call Premake") - AddBoolOption("ServerMode", "server", "Excludes client-only modules/tools/examples") - AddBoolOption("UniteModules", "united", "Builds all the modules as one united library") - AddBoolOption("PlatformSDL2", "platform-sdl2", "Use SDL2 instead of native APIs") - - -- AdditionalCompilationOptions - do - newoption({ - trigger = "compile-options", - description = "Specify additionnal compilation options to be added to every generated project." - }) - - configTable["AdditionalCompilationOptions"] = configTable["AdditionalCompilationOptions"] or "" - if (_OPTIONS["compile-options"] ~= nil) then - configTable["AdditionalCompilationOptions"] = configTable["AdditionalCompilationOptions"] .. ";" .. _OPTIONS["compile-options"] - end - - local configs = {} - local paths = string.explode(configTable["AdditionalCompilationOptions"], ";") - for k,v in pairs(paths) do - if (#v > 0) then - table.insert(configs, v) - end - end - - configTable["AdditionalCompilationOptions"] = configs - end - - -- Configurations - do - newoption({ - trigger = "configurations", - description = "Override configurations target by a new set, separated by commas." - }) - - configTable["Configurations"] = configTable["Configurations"] or "" - if (_OPTIONS["configurations"] ~= nil) then - configTable["Configurations"] = _OPTIONS["configurations"] - end - - local configs = {} - local validConfigs = {"Debug", "Release", "ReleaseWithDebug"} - local paths = string.explode(configTable["Configurations"], ",") - for k,v in pairs(paths) do - v = v:match("^%s*(.-)%s*$") -- Trim - if (#v > 0) then - if (table.contains(validConfigs, v)) then - table.insert(configs, v) - else - error("Invalid entry for configurations option: \"" .. v .. "\"") - end - end - end - - if (#configs == 0) then - error("Invalid entry for configurations option: no option") - end - - configTable["Configurations"] = configs - end - - -- InstallDir - do - newoption({ - trigger = "install-path", - description = "Setup additionnals install directories (library binaries will be copied there), separated by commas" - }) - - configTable["InstallDir"] = configTable["InstallDir"] or "" - if (_OPTIONS["install-path"] ~= nil) then - configTable["InstallDir"] = configTable["InstallDir"] .. ";" .. _OPTIONS["install-path"] - end - - local paths = string.explode(configTable["InstallDir"], ";") - for k,v in pairs(paths) do - if (#v > 0) then - self:AddInstallPath(v) - end - end - end -end - -function NazaraBuild:MakeInstallCommands(infoTable) - if (os.ishost("windows")) then - filter("kind:SharedLib") - - postbuildmessage("Copying " .. infoTable.Name .. " library and its dependencies to install/executable directories...") - - -- Copy built file to install directory - local installCommands = {} - for installPath,_ in pairs(self.InstallDir) do - local destPath = path.translate(path.isabsolute(installPath) and installPath or "../../" .. installPath) - table.insert(installCommands, [[xcopy "%{path.translate(cfg.buildtarget.relpath)}" "]] .. destPath .. [[\" /E /Y]]) - end - table.sort(installCommands) - - for k,command in pairs(installCommands) do - postbuildcommands({command}) - end - - -- Copy additional dependencies to executable directories too - for k,fileName in pairs(table.join(infoTable.Libraries, infoTable.DynLib)) do - local paths = {} - for k,v in pairs(infoTable.BinaryPaths.x86) do - table.insert(paths, {"x86", v .. "/" .. fileName .. ".dll"}) - table.insert(paths, {"x86", v .. "/lib" .. fileName .. ".dll"}) - end - - for k,v in pairs(infoTable.BinaryPaths.x64) do - table.insert(paths, {"x86_64", v .. "/" .. fileName .. ".dll"}) - table.insert(paths, {"x86_64", v .. "/lib" .. fileName .. ".dll"}) - end - - for k,v in pairs(paths) do - local arch = v[1] - local srcPath = v[2] - if (os.isfile(srcPath)) then - if (infoTable.Kind == "plugin") then - srcPath = "../../" .. srcPath - end - - filter("architecture:" .. arch) - - local executableCommands = {} - for execPath,_ in pairs(self.ExecutableDir) do - local srcPath = path.isabsolute(srcPath) and path.translate(srcPath) or [[%{path.translate(cfg.linktarget.relpath:sub(1, -#cfg.linktarget.name - 1) .. "../../]] .. srcPath .. [[")}]] - local destPath = path.translate(path.isabsolute(execPath) and execPath or "../../" .. execPath) - table.insert(executableCommands, [[xcopy "]] .. srcPath .. [[" "]] .. destPath .. [[\" /E /Y]]) - end - - table.sort(executableCommands) - - for k,command in pairs(executableCommands) do - postbuildcommands({command}) - end - end - end - end - - filter({}) - end -end - -local PosixOSes = { - ["bsd"] = true, - ["linux"] = true, - ["macosx"] = true, - ["solaris"] = true -} - -local function ProcessOption(libName, option, enable) - return libName:gsub("%%" .. option .. "%((.+)%)", enable and "%1" or "") -end - -local function HandleLib(infoTable, libName) - local debugDynamic = ProcessOption(ProcessOption(libName, "d", true), "s", false) - local debugStatic = ProcessOption(ProcessOption(libName, "d", true), "s", true) - local releaseStatic = ProcessOption(ProcessOption(libName, "d", false), "s", true) - local releaseDynamic = ProcessOption(ProcessOption(libName, "d", false), "s", false) - - table.insert(infoTable.ConfigurationLibraries.DebugStatic, debugStatic) - table.insert(infoTable.ConfigurationLibraries.ReleaseStatic, releaseStatic) - table.insert(infoTable.ConfigurationLibraries.ReleaseWithDebugStatic, releaseStatic) - table.insert(infoTable.ConfigurationLibraries.DebugDynamic, debugDynamic) - table.insert(infoTable.ConfigurationLibraries.ReleaseDynamic, releaseDynamic) - table.insert(infoTable.ConfigurationLibraries.ReleaseWithDebugDynamic, releaseDynamic) -end - -function NazaraBuild:Process(infoTable) - if (infoTable.Excluded) then - return false - end - - local libraries = {} - for k, library in pairs(infoTable.Libraries) do - local libraryTable = self:GetDependency(infoTable, library) - if (libraryTable) then - if (libraryTable.Excluded) then - infoTable.Excluded = true - infoTable.ExcludeReason = "depends on excluded " .. library .. " " .. libraryTable.Category:lower() - return false - end - - if (libraryTable.Type == "Module") then - if (_OPTIONS["united"]) then - library = "NazaraEngine" - else - library = "Nazara" .. libraryTable.Name .. "%s(-s)%d(-d)" - end - - if (not self.Config["UniteModules"] or infoTable.Type ~= "Module") then - HandleLib(infoTable, library) - end - elseif (libraryTable.Type == "ExternLib") then - library = libraryTable.Name - - if (self.Config["BuildDependencies"]) then - table.insert(libraries, library) - else - HandleLib(infoTable, library) - end - elseif (libraryTable.Type == "Tool") then - library = "Nazara" .. libraryTable.Name .. "%s(-s)%d(-d)" - - -- Import tools includes - for k,v in ipairs(libraryTable.Includes) do - table.insert(infoTable.Includes, v) - end - - for k,v in ipairs(libraryTable.ExtIncludes) do - table.insert(infoTable.ExtIncludes, v) - end - - -- And libraries - for k, v in pairs(libraryTable.Libraries) do - table.insert(infoTable.Libraries, v) - end - - for config, libs in pairs(libraryTable.ConfigurationLibraries) do - for k,v in pairs(libs) do - table.insert(infoTable.ConfigurationLibraries[config], v) - end - end - - HandleLib(infoTable, library) - else - infoTable.Excluded = true - infoTable.ExcludeReason = "dependency " .. library .. " has invalid type \"" .. libraryTable.Type .. "\"" - return false - end - else - HandleLib(infoTable, library) - end - end - infoTable.Libraries = libraries - - for k,v in pairs(infoTable) do - local target = k:match("Os(%w+)") - if (target) then - local targetTable = infoTable[target] - if (targetTable) then - local excludeTargetTable = infoTable[target .. "Excluded"] - for platform, defineTable in pairs(v) do - platform = string.lower(platform) - if (platform == "posix") then - local osname = os.target() - if (PosixOSes[osname]) then - platform = osname - end - end - - if (os.istarget(platform)) then - for k,v in ipairs(defineTable) do - table.insert(targetTable, v) - end - elseif (excludeTargetTable) then - for k,v in ipairs(defineTable) do - table.insert(excludeTargetTable, v) - end - end - end - - infoTable[k] = nil - end - end - end - - if (infoTable.Kind == "application") then - self:AddExecutablePath(infoTable.TargetDirectory) - end - - if (infoTable.Validate) then - local ret, err = infoTable:Validate() - if (not ret) then - infoTable.Excluded = true - infoTable.ExcludeReason = "validation failed: " .. err - return false - end - end - - return true -end - -function NazaraBuild:PreconfigGenericProject() - flags({ - "MultiProcessorCompile", - "NoMinimalRebuild", - "RelativeLinks", - "ShadowedVariables", - "UndefinedIdentifiers" - }) - - cppdialect("C++17") - warnings("Extra") - - self:FilterLibDirectory("../thirdparty/genlib/", libdirs) - self:FilterLibDirectory("../thirdparty/lib/", libdirs) - - -- Fixes Premake stuff - filter({"kind:SharedLib", clangGccActions}) - implibprefix("lib") - filter({"kind:*Lib", clangGccActions, "system:Windows"}) - implibextension(".a") - filter({"kind:StaticLib", clangGccActions}) - targetextension(".a") - targetprefix("lib") - - -- General configuration - filter("kind:*Lib") - pic("On") - - filter({"kind:StaticLib", "configurations:Debug*"}) - targetsuffix("-s-d") - - filter({"kind:StaticLib", "configurations:Release*"}) - targetsuffix("-s") - - filter({"kind:SharedLib", "configurations:Debug*"}) - targetsuffix("-d") - - filter("configurations:*Debug*") - optimize("Debug") - symbols("On") - - filter("configurations:not *Debug*") - omitframepointer("On") - - -- Setup some optimizations for release - filter("configurations:Release*") - defines("NDEBUG") - optimize("Speed") - vectorextensions("SSE2") - - filter("configurations:*Static") - kind("StaticLib") - - filter("configurations:*Dynamic") - kind("SharedLib") - - -- Enable MSVC conformance (not required but better) and some extra warnings - filter("action:vs*") - buildoptions({"/permissive-", "/Zc:__cplusplus", "/Zc:referenceBinding", "/Zc:throwingNew"}) - --enablewarnings("4062") -- switch case not handled - buildoptions("/w44062") -- looks like enablewarnings is broken currently for msvc - - -- Enable SSE math and vectorization optimizations - filter({"configurations:Release*", clangGccActions}) - buildoptions("-mfpmath=sse") - buildoptions("-ftree-vectorize") - - filter({}) - - buildoptions(self.Config["AdditionalCompilationOptions"]) -end - -function NazaraBuild:PostconfigGenericProject() - -- Add options required for C++17 thread and filesystem (have to be linked last) - filter({"action:gmake*", "system:macosx"}) - links("pthread") - - filter({"action:gmake*", "system:not macosx"}) - links("stdc++fs") - links("pthread") - - filter({}) -end - -function NazaraBuild:PreconfigNazaraProject() - self:PreconfigGenericProject() - - language("C++") - - -- Add lib/conf/arch to library search path - self:FilterLibDirectory("../lib/", libdirs) - self:FilterLibDirectory("../lib/", runpathdirs) - - filter("action:vs*") - buildoptions({"/MP", "/bigobj"}) -- Multiprocessus build and big .obj - defines("_CRT_SECURE_NO_WARNINGS") - defines("_SCL_SECURE_NO_WARNINGS") - - filter("architecture:x86_64") - defines("NAZARA_PLATFORM_x64") - - filter("configurations:Debug*") - defines("NAZARA_DEBUG") - - filter("configurations:*Static") - defines("NAZARA_STATIC") - - filter("kind:*Lib") - defines("NAZARA_BUILD") - - filter({"system:Windows", clangGccActions}) - buildoptions("-Wa,-mbig-obj") -- big object - - filter({"system:not Windows", clangGccActions}) - buildoptions("-fvisibility=hidden") - - filter({}) -end - -function NazaraBuild:PostconfigNazaraProject() - self:PostconfigGenericProject() -end - -function NazaraBuild:RegisterAction(actionTable) - if (not actionTable.Manual) then - if (actionTable.Name == nil or type(actionTable.Name) ~= "string" or string.len(actionTable.Name) == 0) then - return false, "Invalid action name" - end - - local lowerCaseName = string.lower(actionTable.Name) - if (self.Actions[lowerCaseName] ~= nil) then - return false, "This action name is already in use" - end - - if (actionTable.Description == nil or type(actionTable.Description) ~= "string") then - return false, "Action description is invalid" - end - - if (string.len(actionTable.Description) == 0) then - return false, "Action description is empty" - end - - if (actionTable.Function == nil or type(actionTable.Function) ~= "function") then - return false, "Action function is invalid" - end - - self.Actions[lowerCaseName] = actionTable - - newaction - { - trigger = lowerCaseName, - description = actionTable.Description, - execute = function () actionTable:Function() end - } - end - - return true -end - -function NazaraBuild:RegisterExample(exampleTable) - if (exampleTable.Name == nil or type(exampleTable.Name) ~= "string" or string.len(exampleTable.Name) == 0) then - return false, "Invalid example name" - end - - local lowerCaseName = exampleTable.Name:lower() - if (self.Examples[lowerCaseName] ~= nil) then - return false, "This library name is already in use" - end - - if (exampleTable.Files == nil or type(exampleTable.Files) ~= "table") then - return false, "Example files table is invalid" - end - - if (#exampleTable.Files == 0) then - return false, "This example has no files" - end - - local files = {} - for k, file in ipairs(exampleTable.Files) do - table.insert(files, "../examples/" .. exampleTable.Directory .. "/" .. file) - end - exampleTable.Files = files - - exampleTable.Type = "Example" - exampleTable.Category = exampleTable.Category or exampleTable.Type - - self.Examples[lowerCaseName] = exampleTable - return true -end - -function NazaraBuild:RegisterExternLibrary(libTable) - if (libTable.Name == nil or type(libTable.Name) ~= "string" or string.len(libTable.Name) == 0) then - return false, "Invalid library name" - end - - local lowerCaseName = libTable.Name:lower() - if (self.ExtLibs[lowerCaseName] ~= nil) then - return false, "This library name is already in use" - end - - if (libTable.Files == nil or type(libTable.Files) ~= "table") then - return false, "Invalid file table" - end - - if (#libTable.Files == 0) then - return false, "This library has no files" - end - - libTable.Type = "ExternLib" - libTable.Category = libTable.Category or libTable.Type - - self.ExtLibs[lowerCaseName] = libTable - return true -end - -function NazaraBuild:RegisterModule(moduleTable) - if (moduleTable.Name == nil or type(moduleTable.Name) ~= "string" or string.len(moduleTable.Name) == 0) then - return false, "Invalid module name" - end - - local lowerCaseName = moduleTable.Name:lower() - if (self.Modules[lowerCaseName] ~= nil) then - return false, "This module name is already in use" - end - - table.insert(moduleTable.Defines, "NAZARA_" .. moduleTable.Name:upper() .. "_BUILD") - table.insert(moduleTable.Files, "../include/Nazara/" .. moduleTable.Name .. "/**.hpp") - table.insert(moduleTable.Files, "../include/Nazara/" .. moduleTable.Name .. "/**.inl") - table.insert(moduleTable.Files, "../src/Nazara/" .. moduleTable.Name .. "/**.hpp") - table.insert(moduleTable.Files, "../src/Nazara/" .. moduleTable.Name .. "/**.inl") - table.insert(moduleTable.Files, "../src/Nazara/" .. moduleTable.Name .. "/**.cpp") - - if (self.Config["UniteModules"] and lowerCaseName ~= "core") then - table.insert(moduleTable.FilesExcluded, "../src/Nazara/" .. moduleTable.Name .. "/Debug/NewOverload.cpp") - end - - moduleTable.Type = "Module" - moduleTable.Category = moduleTable.Category or moduleTable.Type - - self.Modules[lowerCaseName] = moduleTable - return true -end - -function NazaraBuild:RegisterTool(toolTable) - if (toolTable.Name == nil or type(toolTable.Name) ~= "string" or string.len(toolTable.Name) == 0) then - return false, "Invalid tool name" - end - - local lowerCaseName = toolTable.Name:lower() - if (self.Tools[lowerCaseName] ~= nil) then - return false, "This tool name is already in use" - end - - if (toolTable.Kind == nil or type(toolTable.Kind) ~= "string" or string.len(toolTable.Kind) == 0) then - return false, "Invalid tool type" - end - - local lowerCaseKind = toolTable.Kind:lower() - if (lowerCaseKind == "library" or lowerCaseKind == "plugin" or lowerCaseKind == "application") then - toolTable.Kind = lowerCaseKind - else - return false, "Invalid tool type" - end - - if (lowerCaseKind ~= "plugin" and (toolTable.TargetDirectory == nil or type(toolTable.TargetDirectory) ~= "string" or string.len(toolTable.TargetDirectory) == 0)) then - return false, "Invalid tool directory" - end - - toolTable.Type = "Tool" - toolTable.Category = toolTable.Category or toolTable.Type - - self.Tools[lowerCaseName] = toolTable - return true -end - -local globalExcludes = {} -function NazaraBuild:Resolve(infoTable) - if (infoTable.ClientOnly and self.Config["ServerMode"]) then - infoTable.Excluded = true - infoTable.ExcludeReason = "excluded by command-line options (client-only)" - end - - if (infoTable.Excludable) then - local globalExcludeOption = "excludes-" .. infoTable.Category:lower() .. "s" - if (not globalExcludes[infoTable.Category]) then - newoption({ - trigger = globalExcludeOption, - description = "Excludes all " .. string.lower(infoTable.Category) .. "s and projects relying on it" - }) - - globalExcludes[infoTable.Category] = true - end - - local specificExcludeOption = "excludes-" .. string.lower(infoTable.Category .. "-" .. infoTable.Name) - newoption({ - trigger = specificExcludeOption, - description = "Excludes the " .. infoTable.Name .. " " .. string.lower(infoTable.Category) .. " and projects relying on it" - }) - - if (_OPTIONS[globalExcludeOption]) then - infoTable.Excluded = true - infoTable.ExcludeReason = "excluded by global command-line options" - elseif (_OPTIONS[specificExcludeOption]) then - infoTable.Excluded = true - infoTable.ExcludeReason = "excluded by specific command-line options" - end - end - - if (type(infoTable.Libraries) == "function") then - infoTable.Libraries = infoTable.Libraries() - end -end - -function NazaraBuild:SetupInfoTable(infoTable) - infoTable.BinaryPaths = {} - infoTable.BinaryPaths.x86 = {} - infoTable.BinaryPaths.x64 = {} - infoTable.ConfigurationLibraries = {} - infoTable.ConfigurationLibraries.DebugStatic = {} - infoTable.ConfigurationLibraries.ReleaseStatic = {} - infoTable.ConfigurationLibraries.ReleaseWithDebugStatic = {} - infoTable.ConfigurationLibraries.DebugDynamic = {} - infoTable.ConfigurationLibraries.ReleaseDynamic = {} - infoTable.ConfigurationLibraries.ReleaseWithDebugDynamic = {} - infoTable.Excludable = true - infoTable.LibraryPaths = {} - infoTable.LibraryPaths.x86 = {} - infoTable.LibraryPaths.x64 = {} - - local infos = {"Defines", "DynLib", "Files", "FilesExcluded", "Flags", "Includes", "Libraries", "ExtIncludes"} - for k,v in ipairs(infos) do - infoTable[v] = {} - infoTable["Os" .. v] = {} - end -end - -function NazaraBuild:SetupExampleTable(infoTable) - self:SetupInfoTable(infoTable) - - infoTable.Kind = "application" - infoTable.TargetDirectory = "../examples/bin" -end - -function NazaraBuild:SetupExtlibTable(infoTable) - self:SetupInfoTable(infoTable) - - infoTable.Kind = "library" - - table.insert(infoTable.BinaryPaths.x86, "../thirdparty/lib/common/x86") - table.insert(infoTable.BinaryPaths.x64, "../thirdparty/lib/common/x64") - table.insert(infoTable.LibraryPaths.x86, "../thirdparty/lib/common/x86") - table.insert(infoTable.LibraryPaths.x64, "../thirdparty/lib/common/x64") -end - -function NazaraBuild:SetupModuleTable(infoTable) - self:SetupInfoTable(infoTable) - - infoTable.Kind = "library" - - table.insert(infoTable.BinaryPaths.x86, "../thirdparty/lib/common/x86") - table.insert(infoTable.BinaryPaths.x64, "../thirdparty/lib/common/x64") - table.insert(infoTable.LibraryPaths.x86, "../thirdparty/lib/common/x86") - table.insert(infoTable.LibraryPaths.x64, "../thirdparty/lib/common/x64") -end - -NazaraBuild.SetupToolTable = NazaraBuild.SetupInfoTable diff --git a/build/scripts/features/audio.lua b/build/scripts/features/audio.lua deleted file mode 100644 index 3c6a7dea7..000000000 --- a/build/scripts/features/audio.lua +++ /dev/null @@ -1,89 +0,0 @@ -return { - Title = "Module audio", - LibName = "NazaraAudio", - Description = "Module permettant de charger et jouer des sons, ainsi que d'accéder au microphone", - RequiredPortability = Feature.Windows + Feature.POSIX, - - Features = - { - { - Title = "Gestion des émetteurs de sons (SoundEmitter)", - Description = "Classe de base dont héritent les sources sonores (Music, Sound)", - Features = - { - "Positionnement 3D (spatialisation) si désiré", - "Configuration de l'atténuation", - "Prise en charge de l'effet Doppler (vitesse du son)", - "Altération du ton (pitch)" - } - }, - { - Title = "Gestion des tampons sonores (SoundBuffer)", - Description = "Tampon (buffer) stockant les échantillons (samples) décompressés, chargés à partir de fichiers sonores.", - Features = - { - { - Title = "Mixage mono", - Description = "Permet de mixer les différents canaux en un seul (mono), permettant la spatialisation.", - Note = "Le mixage mono n'est actuellement possible qu'au chargement du tampon depuis un fichier", - Progress = 90 - } - } - }, - { - Title = "Gestion des flux sonores (SoundStream)", - Description = "Interface permettant de définir un flux sonore de source indéfinie (fichier, réseau, etc.)" - }, - { - Title = "Sons (Sound)", - Description = "Classe permettant de jouer un tampon sonore", - Features = - { - "Bouclage", - "Mise en pause", - "Récupération/positionnement de l'indice de lecture (offset)" - } - }, - { - Title = "Sons streamés (Music)", - Description = "Classe permettant de jouer un son depuis un flux quelconque (SoundStream)", - Features = - { - "Streaming depuis un fichier sonore (+ mixage mono si demandé)", - "Bouclage", - "Mise en pause", - {Title = "Mixage mono", Note = "Le mixage mono devrait être possible au niveau du son lui-même plutôt qu'au niveau du loader", Progress = 0}, - {Title = "Récupération/positionnement de l'indice de lecture (offset)", Progress = 0} - } - }, - { - Title = "Configuration globale (Audio)", - Description = "Classe permettant de régler les différents paramètres généraux de l'environnement sonore", - Features = - { - "Positionnement/Orientation du listener", - "Réglage du volume général", - "Réglage de la vitesse du son/facteur Doppler" - } - }, - { - Title = "Microphone", - Description = "Classe permettant l'accès aux microphones connectés à l'ordinateur", - Progress = 0 - }, - { - Title = "Environnement (EFX)", - Description = "Prise en charge de l'environnement", - Progress = 0 - }, - { - Title = "Formats supportés (chargement/streaming)", - Description = "Liste des formats de fichiers supportés par le loader inclus par le module (libsndfile)", - Note = "Le populaire format MP3 n'est pas supporté pour des raisons de royalties (mais la flexibilité du moteur vous permet de rajouter votre propre loader MP3)", - Features = - { - "aiff", "au", "avr", "caf", "flac", "htk", "ircam", "mat4", "mat5", "mpc2k", "nist","ogg", "pvf", "raw", "rf64", "sd2", "sds", "svx", "voc", "w64", "wav", "wve" - } - } - } -} \ No newline at end of file diff --git a/build/scripts/features/core.lua b/build/scripts/features/core.lua deleted file mode 100644 index 0c71af179..000000000 --- a/build/scripts/features/core.lua +++ /dev/null @@ -1,203 +0,0 @@ -return { - Title = "Noyau", - LibName = "NazaraCore", - Description = "Noyau du moteur, possède les fonctionnalités utilisées partout ailleurs dans le moteur.", - RequiredPortability = Feature.Windows + Feature.POSIX, - - Features = - { - { - Title = "Classes utilitaires de base", - Description = "Classes assurant certaines fonctionnalités de base destinées à aider le programmeur.", - Features = - { - { - Title = "Chaînes de caractère unicode (String)", - Description = "Classe supplantant std::string, rajoutant le support de l'UTF-8 et quelques opérations utiles (rechercher/remplacer, correspondance par motif, ..)." - }, - { - Title = "Exécution de code lors de la destruction (CallOnExit)", - Description = "Permet l'appel d'une fonction/lambda à la destruction de cet objet, en accordance avec le RAII/RRID." - }, - { - Title = "Gestion de l'initialisation/libération statique de classes, en accordance avec le RAII/RRID", - Description = "Permet d'initialiser et de libérer automatiquement des classes possédant des fonctions membres statiques Initialize/Uninitialize, selon un ordre de dépendance, comme par exemple les classes des modules du moteur lui-même." - }, - { - Title = "Gestion des couleurs (Color)", - Description = "Classe permettant de stocker et effectuer des opérations sur des couleurs (conversion, mélange, etc.)." - }, - { - Title = "Gestion de primitives, au sens géométrique (Primitive, PrimitiveList)", - Description = "Structures définissant certaines primitives géométriques (boite, cône, plan, sphère), utiles pour la génération de meshs (de rendu ou physiques)." - }, - { - Title = "OffsetOf", - Description = "Fonction permettant de récupérer à la compilation l'adresse locale (décalage d'octets) d'un membre de n'importe quelle structure/classe." - }, - { - Title = "Pointeurs à écart (stride) indépendant (SparsePtr)", - Description = "Classe se comportant comme un pointeur, à l'exception de l'écart entre deux éléments (opérations d'accès, d'addition et de soustraction) qui est indépendant du type pointé." - }, - { - Title = "Stockage et gestion de champs de bits dynamiques (Bitset)", - Description = "Classe permettant le stockage et la manipulation optimisée d'un nombre élevé et dynamique de bits (=booléens, opérations de comptage, recherche de bits activés, opérations entre champs de bits, etc.)", - Note = "Il manque une spécialisation de la fonction de hachage", - Progress = 95 - } - } - }, - { - Title = "Gestion de fichiers et dossiers (File/Directory)", - Description = "Classes supportant les chemins unicodes et les tailles 64 bits, ainsi que quelques opérations sur les chemins (normalisation, transformation d'un chemin relatif en chemin absolu).", - Portability = Feature.Windows + Feature.POSIX - }, - { - Title = "Gestion de l'endianness", - Description = "Boutisme, récupération à la compilation ou à l'exécution, possibilité de lire des fichiers en corrigeant le boutisme des objets lors de la lecture." - }, - { - Title = "Gestion de bibliothèques dynamiques (DynLib)", - Description = "Classe permettant de charger à l'exécution des bibliothèques dynamiques (selon la plateforme: .dll/.so/.dynlib) et d'en extraire des fonctions.", - Portability = Feature.Windows + Feature.POSIX - }, - { - Title = "Fonctions de hachage", - Description = "Possibilité de hacher (calculer une somme de contrôle) de n'importe quelles données, chaîne de caractère ou fichier.", - Features = - { - {Title = "CRC16", Progress = 0}, - "CRC32", - "Fletcher16", - {Title = "Fletcher32", Progress = 0}, - "MD5", - "SHA-1", - "SHA-224", - "SHA-256", - "SHA-384", - "SHA-512", - "Whirlpool" - } - }, - { - Title = "Gestion de la mémoire", - Description = "Set de fonctionnalités permettant d'aider le programmeur à gérer la mémoire de son programme.", - Features = - { - { - Title = "MemoryManager", - Description = "Classe permettant de suivre les allocations de mémoire et éventuels leaks, peut suivre automatiquement chaque allocation du programme." - }, - { - Title = "MemoryPool", - Description = "Classe permettant d'allouer/libérer des blocs de mémoire de taille prédéfinie à coût constant." - } - } - }, - { - Title = "Gestion de l'exécution concurrentielle", - Description = "Set de fonctionnalités liées à l'exécution et la synchronisation entre processus légers (threads) sans dépendance sur la bibliothèque standard.", - Features = - { - { - Title = "Thread", - Description = "Classe permettant d'appeler une fonction (avec passage d'arguments) dans un thread, supporte une interface similaire à std::thread.", - Note = "Il n'est pas encore possible de récupérer le Thread::Id courant", - Progress = 95, - Portability = Feature.Windows + Feature.POSIX - }, - { - Title = "Mutex", - Description = "Primitive de synchronisation binaire (exclusion mutuelle).", - Portability = Feature.Windows + Feature.POSIX - }, - { - Title = "Semaphore", - Description = "Primitive de synchronisation à N concurrents simultanés.", - Portability = Feature.Windows + Feature.POSIX - }, - { - Title = "ConditionVariable", - Description = "Primitive de synchronisation à signaux.", - Portability = Feature.Windows + Feature.POSIX - }, - { - Title = "LockGuard", - Description = "Classe utilitaire permettant de verrouiller/déverrouiller une mutex en accordance avec le RAII/RRID." - }, - { - Title = "TaskScheduler", - Description = "Classe permettant de répartir X tâches sur Y workers de façon efficace.", - Portability = Feature.Windows + Feature.POSIX - } - } - }, - { - Title = "Gestion du temps", - Description = "Classes/fonctions permettant de gérer le temps dans un programme.", - Features = - { - { - Title = "Récupération du temps en millisecondes ou en microsecondes", - Description = "Permet de récupérer le nombre de millisecondes ou de microsecondes (si supporté par le système) écoulées depuis un référentiel constant (référentiel indéterminé).", - Portability = Feature.Windows + Feature.POSIX - }, - { - Title = "Clock", - Description = "Classe chronomètre permettant de mesurer le temps écoulé depuis un évènement précis, supporte la mise en pause." - } - } - }, - { - Title = "Gestion de compteurs de référence", - Description = "Set de classes permettant de gérer des pointeurs intelligents partagés intrusifs.", - }, - { - Title = "Gestion de liste de paramètres", - Description = "Classe gérant une liste de paramètres nommées à type variable.", - }, - { - Title = "Gestion de ressources (chargement/gestion)", - Description = "Set de classes s'occupant du chargement et de la gestion de certaines classes spéciales, appartenant au groupe des ressources (ex: chargée depuis un fichier).", - Features = - { - { - Title = "ResourceLibrary", - Description = "Classe template chargée du stockage de ressources de façon nommée." - }, - { - Title = "ResourceLoader", - Description = "Classe template chargée de stocker et gérer des loaders (fonctions s'occupant de transformer un flux de données en ressource)." - }, - { - Title = "ResourceManager", - Description = "Classe template chargée de charger et mettre en cache des ressources depuis un chemin de fichier." - } - } - }, - { - Title = "Gestion des plugins", - Description = "Capacité d'extension du moteur à l'aide de bibliothèques dynamiques conçues dans cette optique.", - Note = "Nécessite une révision, permettant aux plugins de se signaler (nom, version)", - Progress = 80 - }, - { - Title = "Gestion de l'empaquetage bidimensionnel", - Description = "Algorithmes permettant de placer des rectangles 2D arbitraires dans un espace prédéfini de façon à minimiser la perte d'espace.", - Note = "Algorithme Guillotine terminé, algorithme Skyline manquant", - Progress = 60 - }, - { - Title = "Gestion de l'Unicode", - Description = "Récupération d'informations sur les caractères Unicode (si les données Unicode sont incorporées au programme).", - Note = "Il manque l'intégration des UnicodeData dans le moteur", - Progress = 20 - }, - { - Title = "Récupération d'informations sur le hardware", - Description = "Classe permettant, si la plateforme le supporte, de récupérer des informations utiles sur le matériel: nom et fabricant du processeur, nombre de coeurs, support d'un set d'extension (exemple: SSE), quantité de mémoire vive, exécution de l'instruction CPUID.", - Progress = 100, - Portability = Feature.Windows + Feature.POSIX - } - } -} \ No newline at end of file diff --git a/build/scripts/features/index_template.html b/build/scripts/features/index_template.html deleted file mode 100644 index 43bf5aea9..000000000 --- a/build/scripts/features/index_template.html +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - Avancement de Nazara - - -
- Nazara Engine - -
- - Retrouvez le moteur sur GitHub !
- Dépôt GitHub

- Venez vous renseigner sur les topics dédiés à Nazara présents sur plusieurs sites web :
- OpenClassrooms, Progdupeupl ou ZesteDeSavoir -

- ... ou pourquoi ne pas venir faire un tour sur le forum dédié au moteur ? - -
- -

Fonctionnalités de Nazara

- -
Dernière mise à jour : - %DATE% -
- -

Important:

-

Afin de faciliter la mise à jour, la page que vous voyez ici a été générée automatiquement par un script Lua, ce qui m'oblige néanmoins à encoder les fonctionnalités de chaque module dans un premier temps. - C'est un travail assez long (pour vous donner une idée, les données du noyau représentent un fichier de 200 lignes), et il n'est pas encore complet, c'est pourquoi des modules manquent sur cette page.
- Gardez donc à l'esprit que le moteur possède plus de fonctionnalités que ce qui est décrit actuellement sur cette page.

- -

Oh et bien sûr je ne suis pas concepteur de site web, c'est pourquoi cette page est moche (j'ai essayé de minimiser les dégâts).
- Si vous sentez en vous l'irrésistible envie d'améliorer cette page, sachez que votre aide serait grandement appréciée (vous pouvez me contacter via le lien de votre choix plus haut).

- -

Le pourcentage indiqué est calculé automatiquement en fonction des fonctionnalités, cela signifie qu'une fonctionnalité présente sera comptée à 100% à partir du moment où son implémentation de base est considérée fonctionnelle, cela n'est donc pas une assurance qu'aucun bug n'existe concernant cette fonctionnalité (cependant cela signifie que la fonctionnalité est utilisable).
- Et bien entendu, un module ou une fonctionnalité ayant atteint les 100% peut toujours évoluer par la suite.

- -
- - - - - - - - - - - %MODULELIST% - -
Sommaire
ModuleAvancement
- - %MODULEDESCRIPTION% -
- - - - - - - - - - %MODULELIST% - -
Sommaire
ModulePourcentage
-
- - \ No newline at end of file diff --git a/build/scripts/features/style.css b/build/scripts/features/style.css deleted file mode 100644 index ff83f706c..000000000 --- a/build/scripts/features/style.css +++ /dev/null @@ -1,121 +0,0 @@ -/* Je ne suis pas développeur HTML/CSS, je dois y toucher une fois l'an, désolé pour les quelques atrocités que vous pourrez trouver ici */ - -body -{ - font-family: sans-serif; - text-align: center; - margin: 0; - background-color: #f1f1f1; -} - -#englob { - display: block; - margin-left: auto; - margin-right: auto; - background-color: white; - width: 50%; - min-width: 765px; - padding: 0 20px; -} - -hr { - height: 0; - border: 0; - border-top: 1px solid #eee; -} - -a -{ - color: #007ACC; -} - -a:hover -{ - color: lightblue; -} - -h1 -{ - display: inline; -} - -h2 -{ - display: inline; - text-decoration: underline; -} - -h4 -{ - text-decoration: underline; -} - -p { - text-align: justify; -} - -ol -{ - list-style-type: none; -} - -table -{ - border-collapse: collapse; - text-align: center; - display: inline-block; - border: white groove; - border-radius: 10px; - box-shadow: 0px 0px 10px lightblue; -} - -th -{ - text-shadow: 2px 2px 4px black; -} - -tr -{ - border: 1px solid white; -} - -tbody tr:hover -{ - text-shadow: 0px 0px 4px white; -} - -.description -{ - margin-left: 20px; -} - -.lastupdate -{ - font-size: x-large; - font-weight: bold; - color: #f1c40f; -} - -.modulename -{ - font-size: x-large; - font-weight: bold; - text-shadow: 2px 2px 10px #007ACC; -} - -.note -{ - margin-left: 20px; - color: #007ACC; -} - -.notedesc -{ - color: rgb(200, 200, 255); -} - -.portability -{ - margin-left: 20px; - color: red; -} \ No newline at end of file diff --git a/build/scripts/modules/audio.lua b/build/scripts/modules/audio.lua deleted file mode 100644 index 2919b6fe0..000000000 --- a/build/scripts/modules/audio.lua +++ /dev/null @@ -1,37 +0,0 @@ -MODULE.Name = "Audio" - -MODULE.ClientOnly = true - -MODULE.Defines = { - "NAZARA_AUDIO_OPENAL" -} - -MODULE.Libraries = { - "NazaraCore" -} - -MODULE.OsLibraries.Windows = { - "sndfile-1" -} - -MODULE.OsLibraries.Posix = { - "sndfile" -} - -MODULE.OsDynLib.Windows = { - "soft_oal" -} - -MODULE.OsFiles.Windows = { - "../src/Nazara/Audio/Win32/**.hpp", - "../src/Nazara/Audio/Win32/**.cpp" -} - -MODULE.OsFiles.Posix = { - "../src/Nazara/Audio/Posix/**.hpp", - "../src/Nazara/Audio/Posix/**.cpp" -} - -MODULE.DynLib = { - "soft_oal" -} diff --git a/build/scripts/modules/core.lua b/build/scripts/modules/core.lua deleted file mode 100644 index e998080f8..000000000 --- a/build/scripts/modules/core.lua +++ /dev/null @@ -1,24 +0,0 @@ -MODULE.Name = "Core" -MODULE.Excludable = false -- Excluding the core makes no sense as everything relies on it - -MODULE.Files = { -- Other files will be automatically added - "../include/Nazara/Prerequisites.hpp", - "../include/Nazara/Math/**.hpp", - "../include/Nazara/Math/**.inl", -} - -MODULE.OsFiles.Windows = { - "../src/Nazara/Core/Win32/**.hpp", - "../src/Nazara/Core/Win32/**.cpp" -} - -MODULE.OsFiles.Posix = { - "../src/Nazara/Core/Posix/**.hpp", - "../src/Nazara/Core/Posix/**.cpp" -} - -MODULE.OsLibraries.Posix = { - "dl", - "m", -- Math library (for sincos()) - "pthread" -} diff --git a/build/scripts/modules/graphics.lua b/build/scripts/modules/graphics.lua deleted file mode 100644 index 92a087236..000000000 --- a/build/scripts/modules/graphics.lua +++ /dev/null @@ -1,10 +0,0 @@ -MODULE.Name = "Graphics" - -MODULE.ClientOnly = true - -MODULE.Libraries = { - "NazaraCore", - "NazaraRenderer", - "NazaraShader", - "NazaraUtility" -} diff --git a/build/scripts/modules/network.lua b/build/scripts/modules/network.lua deleted file mode 100644 index 9245d72f3..000000000 --- a/build/scripts/modules/network.lua +++ /dev/null @@ -1,29 +0,0 @@ -MODULE.Name = "Network" - -MODULE.Libraries = { - "NazaraCore" -} - -MODULE.OsFiles.Windows = { - "../src/Nazara/Network/Win32/**.hpp", - "../src/Nazara/Network/Win32/**.cpp" -} - -MODULE.OsFiles.Posix = { - "../src/Nazara/Network/Posix/**.hpp", - "../src/Nazara/Network/Posix/**.cpp" -} - -MODULE.OsFiles.Linux = { - "../src/Nazara/Network/Linux/**.hpp", - "../src/Nazara/Network/Linux/**.cpp" -} - -MODULE.OsFilesExcluded.Linux = { - "../src/Nazara/Network/Posix/SocketPollerImpl.hpp", - "../src/Nazara/Network/Posix/SocketPollerImpl.cpp" -} - -MODULE.OsLibraries.Windows = { - "ws2_32" -} diff --git a/build/scripts/modules/physics2d.lua b/build/scripts/modules/physics2d.lua deleted file mode 100644 index 58d0a08f5..000000000 --- a/build/scripts/modules/physics2d.lua +++ /dev/null @@ -1,12 +0,0 @@ -MODULE.Name = "Physics2D" - -MODULE.Defines = {"CP_USE_CGTYPES=0", "TARGET_OS_IPHONE=0", "TARGET_OS_MAC=0"} - -MODULE.Libraries = { - "NazaraCore", - "chipmunk" -} - -MODULE.DynLib = { - "chipmunk" -} diff --git a/build/scripts/modules/physics3d.lua b/build/scripts/modules/physics3d.lua deleted file mode 100644 index 893948e76..000000000 --- a/build/scripts/modules/physics3d.lua +++ /dev/null @@ -1,30 +0,0 @@ -MODULE.Name = "Physics3D" - -MODULE.Defines = { - "_NEWTON_STATIC_LIB" -} - -MODULE.OsDefines.Windows = { - "_WINDOWS" -} - -MODULE.Libraries = { - "NazaraCore", - "newton" -- Newton Game Dynamics -} - -MODULE.Custom = function() - vectorextensions("SSE3") - - filter({"architecture:x86_64", "system:linux"}) - defines("_POSIX_VER_64") - - filter({"architecture:x86", "system:linux"}) - defines("_POSIX_VER") - - filter({"architecture:x86_64", "system:macosx"}) - defines("_POSIX_VER_64") - - filter({"architecture:x86", "system:macosx"}) - defines("_POSIX_VER") -end diff --git a/build/scripts/modules/platform.lua b/build/scripts/modules/platform.lua deleted file mode 100644 index fbf1b94af..000000000 --- a/build/scripts/modules/platform.lua +++ /dev/null @@ -1,35 +0,0 @@ -MODULE.Name = "Platform" - -MODULE.ClientOnly = true - -MODULE.Defines = { - "NAZARA_PLATFORM_SDL2" -} - -MODULE.Libraries = { - "NazaraCore", - "NazaraUtility", - "SDL2" -} - -MODULE.Files = { - "../src/Nazara/Platform/SDL2/**.hpp", - "../src/Nazara/Platform/SDL2/**.cpp" -} - -MODULE.OsDefines.Windows = { - "SDL_VIDEO_DRIVER_WINDOWS=1" -} - -MODULE.DynLib = { - "SDL2" -} - -MODULE.Custom = function() - filter("system:linux") - defines("SDL_VIDEO_DRIVER_X11=1") - defines("SDL_VIDEO_DRIVER_WAYLAND=1") - - filter("system:macosx") - defines("SDL_VIDEO_DRIVER_COCOA=1") -end diff --git a/build/scripts/modules/renderer.lua b/build/scripts/modules/renderer.lua deleted file mode 100644 index f371bc5d1..000000000 --- a/build/scripts/modules/renderer.lua +++ /dev/null @@ -1,20 +0,0 @@ -MODULE.Name = "Renderer" - -MODULE.ClientOnly = true - -MODULE.Libraries = { - "NazaraCore", - "NazaraShader", - "NazaraUtility", - "NazaraPlatform" -} - -MODULE.OsFiles.Windows = { - "../src/Nazara/Renderer/Win32/**.hpp", - "../src/Nazara/Renderer/Win32/**.cpp" -} - -MODULE.OsFiles.Posix = { - "../src/Nazara/Renderer/GLX/**.hpp", - "../src/Nazara/Renderer/GLX/**.cpp" -} diff --git a/build/scripts/modules/shader.lua b/build/scripts/modules/shader.lua deleted file mode 100644 index a0a22a663..000000000 --- a/build/scripts/modules/shader.lua +++ /dev/null @@ -1,6 +0,0 @@ -MODULE.Name = "Shader" - -MODULE.Libraries = { - "NazaraCore", - "NazaraUtility" -} diff --git a/build/scripts/modules/utility.lua b/build/scripts/modules/utility.lua deleted file mode 100644 index fc4c989d8..000000000 --- a/build/scripts/modules/utility.lua +++ /dev/null @@ -1,15 +0,0 @@ -MODULE.Name = "Utility" - -MODULE.Libraries = { - "NazaraCore", - "stb_image" -} - -MODULE.OsLibraries.Windows = { - "freetype-s" -} - -MODULE.OsLibraries.Posix = { - "freetype" -} - diff --git a/build/scripts/tools/assimp.lua b/build/scripts/tools/assimp.lua deleted file mode 100644 index 7410079e5..000000000 --- a/build/scripts/tools/assimp.lua +++ /dev/null @@ -1,25 +0,0 @@ -TOOL.Name = "Assimp" - -TOOL.Directory = "../plugins/Assimp" -TOOL.Kind = "Plugin" - -TOOL.Includes = { - "../include", - "../plugins/Assimp" -} - -TOOL.ExtIncludes = { - "../thirdparty/include" -} - -TOOL.Files = { - "../plugins/Assimp/**.hpp", - "../plugins/Assimp/**.inl", - "../plugins/Assimp/**.cpp" -} - -TOOL.Libraries = { - "NazaraCore", - "NazaraUtility", - "assimp" -} diff --git a/build/scripts/tools/ndk.lua b/build/scripts/tools/ndk.lua deleted file mode 100644 index 49d7ee94d..000000000 --- a/build/scripts/tools/ndk.lua +++ /dev/null @@ -1,34 +0,0 @@ -TOOL.Name = "SDK" - -TOOL.Directory = "../SDK" -TOOL.Kind = "Library" -TOOL.TargetDirectory = "../lib" - -TOOL.Defines = { - "NDK_BUILD" -} - -TOOL.Includes = { - "../include", - "../src" -} - -TOOL.Files = { - "../include/NazaraSDK/**.hpp", - "../include/NazaraSDK/**.inl", - "../src/NazaraSDK/**.hpp", - "../src/NazaraSDK/**.inl", - "../src/NazaraSDK/**.cpp" -} - -TOOL.Libraries = function() - local libraries = {} - for k,v in pairs(NazaraBuild.Modules) do - table.insert(libraries, "Nazara" .. v.Name) - end - - -- Keep libraries in the same order to prevent useless premake regeneration - table.sort(libraries) - - return libraries -end \ No newline at end of file diff --git a/build/scripts/tools/ndk_server.lua b/build/scripts/tools/ndk_server.lua deleted file mode 100644 index e50d8c802..000000000 --- a/build/scripts/tools/ndk_server.lua +++ /dev/null @@ -1,51 +0,0 @@ -TOOL.Name = "SDKServer" - -TOOL.Directory = "../SDK" -TOOL.Kind = "Library" -TOOL.TargetDirectory = "../lib" - -TOOL.Defines = { - "NDK_BUILD", - "NDK_SERVER" -} - -TOOL.Includes = { - "../include", - "../src" -} - -TOOL.Files = { - "../include/NazaraSDK/**.hpp", - "../include/NazaraSDK/**.inl", - "../src/NazaraSDK/**.hpp", - "../src/NazaraSDK/**.inl", - "../src/NazaraSDK/**.cpp" -} - --- Excludes client-only files -TOOL.FilesExcluded = { - "../*/NazaraSDK/BaseWidget.*", - "../*/NazaraSDK/Canvas.*", - "../*/NazaraSDK/Console.*", - "../*/NazaraSDK/**/CameraComponent.*", - "../*/NazaraSDK/**/DebugComponent.*", - "../*/NazaraSDK/**/DebugSystem.*", - "../*/NazaraSDK/**/GraphicsComponent.*", - "../*/NazaraSDK/**/LightComponent.*", - "../*/NazaraSDK/**/ListenerComponent.*", - "../*/NazaraSDK/**/ListenerSystem.*", - "../*/NazaraSDK/**/Particle*Component.*", - "../*/NazaraSDK/**/ParticleSystem.*", - "../*/NazaraSDK/**/RenderSystem.*", - "../*/NazaraSDK/**/*Layout*.*", - "../*/NazaraSDK/**/*Widget*.*" -} - -TOOL.Libraries = { - "NazaraCore", - "NazaraNetwork", - "NazaraPhysics2D", - "NazaraPhysics3D", - "NazaraShader", - "NazaraUtility" -} diff --git a/build/scripts/tools/openglrenderer.lua b/build/scripts/tools/openglrenderer.lua deleted file mode 100644 index 1bdeb2ce6..000000000 --- a/build/scripts/tools/openglrenderer.lua +++ /dev/null @@ -1,57 +0,0 @@ -TOOL.Name = "OpenGLRenderer" - -TOOL.ClientOnly = true - -TOOL.Kind = "Library" -TOOL.TargetDirectory = "../lib" - -TOOL.Defines = { - "NAZARA_BUILD", - "NAZARA_OPENGLRENDERER_BUILD" -} - -TOOL.Includes = { - "../include", - "../src/" -} - -TOOL.ExtIncludes = { - "../extlibs/include" -} - -TOOL.Files = { - "../include/Nazara/OpenGLRenderer/**.hpp", - "../include/Nazara/OpenGLRenderer/**.inl", - "../src/Nazara/OpenGLRenderer/**.hpp", - "../src/Nazara/OpenGLRenderer/**.inl", - "../src/Nazara/OpenGLRenderer/**.cpp" -} - -TOOL.Libraries = { - "NazaraCore", - "NazaraPlatform", - "NazaraRenderer", - "NazaraShader", - "NazaraUtility" -} - -TOOL.OsFiles.Windows = { - "../include/Nazara/OpenGLRenderer/Wrapper/Win32/**.hpp", - "../include/Nazara/OpenGLRenderer/Wrapper/Win32/**.inl", - "../include/Nazara/OpenGLRenderer/Wrapper/WGL/**.hpp", - "../include/Nazara/OpenGLRenderer/Wrapper/WGL/**.inl", - "../src/Nazara/OpenGLRenderer/Wrapper/Win32/**.hpp", - "../src/Nazara/OpenGLRenderer/Wrapper/Win32/**.inl", - "../src/Nazara/OpenGLRenderer/Wrapper/Win32/**.cpp", - "../src/Nazara/OpenGLRenderer/Wrapper/WGL/**.hpp", - "../src/Nazara/OpenGLRenderer/Wrapper/WGL/**.inl", - "../src/Nazara/OpenGLRenderer/Wrapper/WGL/**.cpp" -} - -TOOL.OsFiles.Linux = { - "../include/Nazara/OpenGLRenderer/Wrapper/Linux/**.hpp", - "../include/Nazara/OpenGLRenderer/Wrapper/Linux/**.inl", - "../src/Nazara/OpenGLRenderer/Wrapper/Linux/**.hpp", - "../src/Nazara/OpenGLRenderer/Wrapper/Linux/**.inl", - "../src/Nazara/OpenGLRenderer/Wrapper/Linux/**.cpp" -} diff --git a/build/scripts/tools/shadernodes.lua b/build/scripts/tools/shadernodes.lua deleted file mode 100644 index d5a09677f..000000000 --- a/build/scripts/tools/shadernodes.lua +++ /dev/null @@ -1,95 +0,0 @@ -TOOL.Name = "ShaderNodes" - -TOOL.ClientOnly = true -TOOL.EnableConsole = true -TOOL.Kind = "Application" -TOOL.TargetDirectory = "../bin" - -TOOL.Defines = { - "NODE_EDITOR_SHARED" -} - -TOOL.Includes = { - "../include", - "../src" -} - -TOOL.ExtIncludes = { - "../extlibs/include" -} - -TOOL.Files = { - "../src/ShaderNode/**.hpp", - "../src/ShaderNode/**.inl", - "../src/ShaderNode/**.cpp" -} - -TOOL.Libraries = { - "NazaraCore%s(-s)%d(-d)", - "NazaraShader%s(-s)%d(-d)", - "NazaraUtility%s(-s)%d(-d)", - "Qt5Core%d(d)", - "Qt5Gui%d(d)", - "Qt5Widgets%d(d)", - "nodes%d(d)" -} - -local function AppendValues(tab, value) - if (type(value) == "table") then - for _, v in pairs(value) do - AppendValues(tab, v) - end - else - table.insert(tab, value) - end -end - -function TOOL:ValidateLib(libName) - local config = NazaraBuild:GetConfig() - local includes = config[libName .. "IncludeDir"] - local binDir32 = config[libName .. "BinDir_x86"] - local binDir64 = config[libName .. "BinDir_x64"] - local libDir32 = config[libName .. "LibDir_x86"] - local libDir64 = config[libName .. "LibDir_x64"] - if (not includes) then - return false, "missing " .. libName .. " includes directories in config.lua" - end - - if (not libDir32 and not libDir64) then - return false, "missing " .. libName .. " library search directories in config.lua" - end - - AppendValues(self.Includes, includes) - - if (binDir32) then - AppendValues(self.BinaryPaths.x86, binDir32) - end - - if (binDir64) then - AppendValues(self.BinaryPaths.x64, binDir64) - end - - if (libDir32) then - AppendValues(self.LibraryPaths.x86, libDir32) - end - - if (libDir64) then - AppendValues(self.LibraryPaths.x64, libDir64) - end - - return true -end - -function TOOL:Validate() - local success, err = self:ValidateLib("Qt5") - if (not success) then - return false, err - end - - local success, err = self:ValidateLib("QtNodes") - if (not success) then - return false, err - end - - return true -end \ No newline at end of file diff --git a/build/scripts/tools/unittests.lua b/build/scripts/tools/unittests.lua deleted file mode 100644 index adf06a97a..000000000 --- a/build/scripts/tools/unittests.lua +++ /dev/null @@ -1,27 +0,0 @@ -TOOL.Name = "UnitTests" - -TOOL.Category = "Test" -TOOL.Directory = "../tests" -TOOL.EnableConsole = true -TOOL.Kind = "Application" -TOOL.TargetDirectory = TOOL.Directory - -TOOL.Defines = { -} - -TOOL.Includes = { - "../include" -} - -TOOL.Files = { - "../tests/main.cpp", - "../tests/Engine/**.hpp", - "../tests/Engine/**.cpp", - "../tests/SDK/**.hpp", - "../tests/SDK/**.cpp" -} - -TOOL.Libraries = { - "NazaraNetwork", - "NazaraSDK" -} diff --git a/build/scripts/tools/unittests_server.lua b/build/scripts/tools/unittests_server.lua deleted file mode 100644 index b42c62185..000000000 --- a/build/scripts/tools/unittests_server.lua +++ /dev/null @@ -1,38 +0,0 @@ -TOOL.Name = "UnitTestsServer" - -TOOL.Category = "Test" -TOOL.Directory = "../tests" -TOOL.EnableConsole = true -TOOL.Kind = "Application" -TOOL.TargetDirectory = TOOL.Directory - -TOOL.Defines = { - "NDK_SERVER" -} - -TOOL.Includes = { - "../include" -} - -TOOL.Files = { - "../tests/main.cpp", - "../tests/Engine/**.hpp", - "../tests/Engine/**.cpp", - "../tests/SDK/**.hpp", - "../tests/SDK/**.cpp" -} - --- Excludes client-only files -TOOL.FilesExcluded = { - "../tests/Engine/Audio/**", - "../tests/Engine/Graphics/**", - "../tests/Engine/Platform/**", - "../tests/SDK/NDK/Application.cpp", - "../tests/SDK/NDK/Systems/ListenerSystem.cpp", - "../tests/SDK/NDK/Systems/RenderSystem.cpp" -} - -TOOL.Libraries = { - "NazaraNetwork", - "NazaraSDKServer" -} diff --git a/build/scripts/tools/vulkanrenderer.lua b/build/scripts/tools/vulkanrenderer.lua deleted file mode 100644 index 63cdcf1c1..000000000 --- a/build/scripts/tools/vulkanrenderer.lua +++ /dev/null @@ -1,56 +0,0 @@ -TOOL.Name = "VulkanRenderer" - -TOOL.ClientOnly = true - -TOOL.Kind = "Library" -TOOL.TargetDirectory = "../lib" - -TOOL.Defines = { - "NAZARA_BUILD", - "NAZARA_VULKANRENDERER_BUILD", - "VK_NO_PROTOTYPES" -} - -TOOL.Includes = { - "../include", - "../src/" -} - -TOOL.ExtIncludes = { - "../extlibs/include" -} - -TOOL.Files = { - "../include/Nazara/VulkanRenderer/**.hpp", - "../include/Nazara/VulkanRenderer/**.inl", - "../src/Nazara/VulkanRenderer/**.hpp", - "../src/Nazara/VulkanRenderer/**.inl", - "../src/Nazara/VulkanRenderer/**.cpp" -} - -TOOL.Libraries = { - "NazaraCore", - "NazaraPlatform", - "NazaraRenderer", - "NazaraShader", - "NazaraUtility" -} - -TOOL.OsDefines.Linux = { --- "VK_USE_PLATFORM_MIR_KHR", --- "VK_USE_PLATFORM_XCB_KHR" - "VK_USE_PLATFORM_XLIB_KHR", - "VK_USE_PLATFORM_WAYLAND_KHR" -} - -TOOL.OsDefines.BSD = TOOL.OsDefines.Linux -TOOL.OsDefines.Solaris = TOOL.OsDefines.Linux - -TOOL.OsDefines.Windows = { - "VK_USE_PLATFORM_WIN32_KHR" -} - -TOOL.OsFiles.Windows = { - "../src/Nazara/VulkanRenderer/Win32/**.hpp", - "../src/Nazara/VulkanRenderer/Win32/**.cpp" -}