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)
This commit is contained in:
Lynix 2018-01-14 14:24:23 +01:00
parent fe278bae4b
commit 0b2d5b9332
3 changed files with 13 additions and 7 deletions

View File

@ -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.

View File

@ -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

View File

@ -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