From 0b2d5b93329658828d0b40743b64a0bdbb054da7 Mon Sep 17 00:00:00 2001 From: Lynix Date: Sun, 14 Jan 2018 14:24:23 +0100 Subject: [PATCH] Build: Improve coherence This will prevent regeneration of the project for no reason. There's a remaining bug with the units tests (which sometimes are processed before SDK, thus ending with less dependencies libraries) --- ChangeLog.md | 1 + build/scripts/common.lua | 16 +++++++++------- build/scripts/tools/ndk.lua | 3 +++ 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index 59d366d33..80276aa97 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -8,6 +8,7 @@ Miscellaneous: - ⚠️ Merged NazaraExtlibs workspace to main workspace (allowing `make` command to work without -f parameter) and removed extern libraries precompiled - Updated stb_image to version 2.16 and stb_image_write to version 1.07 (allowing support for JPEG writing) - ⚠️ Renamed extlibs folder to thirdparty +- Partial fix for Premake regenerating projects for no reason Nazara Engine: - VertexMapper:GetComponentPtr no longer throw an error if component is disabled or incompatible with template type, instead a null pointer is returned. diff --git a/build/scripts/common.lua b/build/scripts/common.lua index 5440ee309..adc069ab5 100644 --- a/build/scripts/common.lua +++ b/build/scripts/common.lua @@ -4,12 +4,12 @@ NazaraBuild = {} local clangGccActions = "action:" .. table.concat({"codeblocks", "codelite", "gmake", "xcode3", "xcode4"}, " or ") function NazaraBuild:AddExecutablePath(path) - self.ExecutableDir[path] = true - self.InstallDir[path] = true + table.insert(self.ExecutableDir, path) + self:AddInstallPath(path) end function NazaraBuild:AddInstallPath(path) - self.InstallDir[path] = true + table.insert(self.InstallDir, path) end function NazaraBuild:FilterLibDirectory(prefix, func) @@ -602,11 +602,13 @@ function NazaraBuild:MakeInstallCommands(infoTable) postbuildmessage("Copying " .. infoTable.Name .. " library and its dependencies to install/executable directories...") - for k,v in pairs(self.InstallDir) do - local destPath = path.translate(path.isabsolute(k) and k or "../../" .. k) + -- Copy built file to install directory + for k,installPath in pairs(self.InstallDir) do + local destPath = path.translate(path.isabsolute(installPath) and installPath or "../../" .. installPath) postbuildcommands({[[xcopy "%{path.translate(cfg.buildtarget.relpath)}" "]] .. destPath .. [[\" /E /Y]]}) 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 @@ -629,9 +631,9 @@ function NazaraBuild:MakeInstallCommands(infoTable) filter("architecture:" .. arch) - for k,v in pairs(self.ExecutableDir) do + for k,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(k) and k or "../../" .. k) + local destPath = path.translate(path.isabsolute(execPath) and execPath or "../../" .. execPath) postbuildcommands({[[xcopy "]] .. srcPath .. [[" "]] .. destPath .. [[\" /E /Y]]}) end end diff --git a/build/scripts/tools/ndk.lua b/build/scripts/tools/ndk.lua index 6c98029ef..7cb1f24a5 100644 --- a/build/scripts/tools/ndk.lua +++ b/build/scripts/tools/ndk.lua @@ -27,5 +27,8 @@ TOOL.Libraries = function() 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