From 456f2b32e76617e6a737d4361e132d0c4cb4bda0 Mon Sep 17 00:00:00 2001 From: Lynix Date: Sun, 10 Jun 2018 15:49:11 +0200 Subject: [PATCH] Build: Fix install/executable paths --- build/scripts/common.lua | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/build/scripts/common.lua b/build/scripts/common.lua index 6eb1cfa64..5c1298fb1 100644 --- a/build/scripts/common.lua +++ b/build/scripts/common.lua @@ -4,12 +4,13 @@ NazaraBuild = {} local clangGccActions = "action:" .. table.concat({"codeblocks", "codelite", "gmake*", "xcode3", "xcode4"}, " or ") function NazaraBuild:AddExecutablePath(path) - table.insert(self.ExecutableDir, path) + self.ExecutableDir[path] = true + self:AddInstallPath(path) end function NazaraBuild:AddInstallPath(path) - table.insert(self.InstallDir, path) + self.InstallDir[path] = true end function NazaraBuild:FilterLibDirectory(prefix, func) @@ -613,9 +614,15 @@ function NazaraBuild:MakeInstallCommands(infoTable) postbuildmessage("Copying " .. infoTable.Name .. " library and its dependencies to install/executable directories...") -- Copy built file to install directory - for k,installPath in pairs(self.InstallDir) do + local installCommands = {} + for 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]]}) + 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 @@ -641,10 +648,17 @@ function NazaraBuild:MakeInstallCommands(infoTable) filter("architecture:" .. arch) - for k,execPath in pairs(self.ExecutableDir) do + 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) - postbuildcommands({[[xcopy "]] .. srcPath .. [[" "]] .. destPath .. [[\" /E /Y]]}) + table.insert(executableCommands, [[xcopy "]] .. srcPath .. [[" "]] .. destPath .. [[\" /E /Y]]) + end + + table.sort(executableCommands) + + for k,command in pairs(executableCommands) do + postbuildcommands({command}) end end end