Build: Fix install/executable paths

This commit is contained in:
Lynix 2018-06-10 15:49:11 +02:00
parent 0bea301a48
commit 456f2b32e7
1 changed files with 20 additions and 6 deletions

View File

@ -4,12 +4,13 @@ NazaraBuild = {}
local clangGccActions = "action:" .. table.concat({"codeblocks", "codelite", "gmake*", "xcode3", "xcode4"}, " or ") local clangGccActions = "action:" .. table.concat({"codeblocks", "codelite", "gmake*", "xcode3", "xcode4"}, " or ")
function NazaraBuild:AddExecutablePath(path) function NazaraBuild:AddExecutablePath(path)
table.insert(self.ExecutableDir, path) self.ExecutableDir[path] = true
self:AddInstallPath(path) self:AddInstallPath(path)
end end
function NazaraBuild:AddInstallPath(path) function NazaraBuild:AddInstallPath(path)
table.insert(self.InstallDir, path) self.InstallDir[path] = true
end end
function NazaraBuild:FilterLibDirectory(prefix, func) 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...") postbuildmessage("Copying " .. infoTable.Name .. " library and its dependencies to install/executable directories...")
-- Copy built file to install directory -- 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) 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 end
-- Copy additional dependencies to executable directories too -- Copy additional dependencies to executable directories too
@ -641,10 +648,17 @@ function NazaraBuild:MakeInstallCommands(infoTable)
filter("architecture:" .. arch) 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 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) 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 end
end end