Build: Copy all dependency modules to the example directory

Former-commit-id: e6c2cb47433d84c17e7277125180469f2b3f0d37
This commit is contained in:
Lynix 2016-05-16 20:02:59 +02:00
parent 59b9e96f21
commit 4ecc701ad2
1 changed files with 30 additions and 23 deletions

View File

@ -190,25 +190,7 @@ function NazaraBuild:Execute()
-- Copy the module binaries to the example folder -- Copy the module binaries to the example folder
if (os.is("windows")) then if (os.is("windows")) then
configuration({}) self:MakeCopyAfterBuild(moduleTable)
postbuildcommands({[[xcopy "%{path.translate(cfg.linktarget.relpath):sub(1, -5) .. ".dll"}" "..\..\..\examples\bin\" /E /Y]]})
for k,v in pairs(table.join(moduleTable.Libraries, moduleTable.DynLib)) do
local paths = {}
table.insert(paths, {"x32", "../extlibs/lib/common/x86/" .. v .. ".dll"})
table.insert(paths, {"x32", "../extlibs/lib/common/x86/lib" .. v .. ".dll"})
table.insert(paths, {"x64", "../extlibs/lib/common/x64/" .. v .. ".dll"})
table.insert(paths, {"x64", "../extlibs/lib/common/x64/lib" .. v .. ".dll"})
for k,v in pairs(paths) do
local config = v[1]
local path = v[2]
if (os.isfile(path)) then
configuration(config)
postbuildcommands({[[xcopy "%{path.translate(cfg.linktarget.relpath:sub(1, -#cfg.linktarget.name - 1) .. "../../]] .. path .. [[")}" "..\..\..\examples\bin\" /E /Y]]})
end
end
end
end end
configuration({"vs*", "x32"}) configuration({"vs*", "x32"})
@ -323,10 +305,7 @@ function NazaraBuild:Execute()
-- Copy the module binaries to the example folder -- Copy the module binaries to the example folder
if (toolTable.CopyTargetToExampleDir) then if (toolTable.CopyTargetToExampleDir) then
if (os.is("windows")) then self:MakeCopyAfterBuild(toolTable)
configuration({})
postbuildcommands({[[xcopy "%{path.translate(cfg.linktarget.relpath):sub(1, -5) .. ".dll"}" "..\..\..\examples\bin\" /E /Y]]})
end
end end
configuration({"vs*", "x32"}) configuration({"vs*", "x32"})
@ -867,6 +846,34 @@ function NazaraBuild:Process(infoTable)
end end
end end
function NazaraBuild:MakeCopyAfterBuild(infoTable)
if (os.is("windows")) then
configuration({})
postbuildcommands({[[xcopy "%{path.translate(cfg.linktarget.relpath):sub(1, -5) .. ".dll"}" "..\..\..\examples\bin\" /E /Y]]})
for k,v in pairs(table.join(infoTable.Libraries, infoTable.DynLib)) do
local paths = {}
table.insert(paths, {"x32", "../extlibs/lib/common/x86/" .. v .. ".dll"})
table.insert(paths, {"x32", "../extlibs/lib/common/x86/lib" .. v .. ".dll"})
table.insert(paths, {"x64", "../extlibs/lib/common/x64/" .. v .. ".dll"})
table.insert(paths, {"x64", "../extlibs/lib/common/x64/lib" .. v .. ".dll"})
for k,v in pairs(paths) do
local config = v[1]
local path = v[2]
if (os.isfile(path)) then
if (infoTable.Kind == "plugin") then
path = "../../" .. path
end
configuration(config)
postbuildcommands({[[xcopy "%{path.translate(cfg.linktarget.relpath:sub(1, -#cfg.linktarget.name - 1) .. "../../]] .. path .. [[")}" "..\..\..\examples\bin\" /E /Y]]})
end
end
end
end
end
function NazaraBuild:SetupInfoTable(infoTable) function NazaraBuild:SetupInfoTable(infoTable)
infoTable.ConfigurationLibraries = {} infoTable.ConfigurationLibraries = {}
infoTable.ConfigurationLibraries.DebugStatic = {} infoTable.ConfigurationLibraries.DebugStatic = {}