Build: Improve code and allow to be platform specific about everything
Former-commit-id: 7f13e1a49ad33da26c1841ee550c9de03303cd80
This commit is contained in:
parent
4996b158c2
commit
0aac3ab33e
|
|
@ -85,7 +85,7 @@ function NazaraBuild:Execute()
|
||||||
location(_ACTION .. "/extlibs")
|
location(_ACTION .. "/extlibs")
|
||||||
|
|
||||||
files(libTable.Files)
|
files(libTable.Files)
|
||||||
excludes(libTable.FilesExclusion)
|
excludes(libTable.FilesExcluded)
|
||||||
|
|
||||||
defines(libTable.Defines)
|
defines(libTable.Defines)
|
||||||
flags(libTable.Flags)
|
flags(libTable.Flags)
|
||||||
|
|
@ -226,7 +226,7 @@ function NazaraBuild:Execute()
|
||||||
configuration({})
|
configuration({})
|
||||||
|
|
||||||
files(moduleTable.Files)
|
files(moduleTable.Files)
|
||||||
excludes(moduleTable.FilesExclusion)
|
excludes(moduleTable.FilesExcluded)
|
||||||
|
|
||||||
defines(moduleTable.Defines)
|
defines(moduleTable.Defines)
|
||||||
flags(moduleTable.Flags)
|
flags(moduleTable.Flags)
|
||||||
|
|
@ -354,7 +354,7 @@ function NazaraBuild:Execute()
|
||||||
configuration({})
|
configuration({})
|
||||||
|
|
||||||
files(toolTable.Files)
|
files(toolTable.Files)
|
||||||
excludes(toolTable.FilesExclusion)
|
excludes(toolTable.FilesExcluded)
|
||||||
|
|
||||||
defines(toolTable.Defines)
|
defines(toolTable.Defines)
|
||||||
flags(toolTable.Flags)
|
flags(toolTable.Flags)
|
||||||
|
|
@ -389,7 +389,7 @@ function NazaraBuild:Execute()
|
||||||
targetdir("../examples/bin")
|
targetdir("../examples/bin")
|
||||||
|
|
||||||
files(exampleTable.Files)
|
files(exampleTable.Files)
|
||||||
excludes(exampleTable.FilesExclusion)
|
excludes(exampleTable.FilesExcluded)
|
||||||
|
|
||||||
defines(exampleTable.Defines)
|
defines(exampleTable.Defines)
|
||||||
flags(exampleTable.Flags)
|
flags(exampleTable.Flags)
|
||||||
|
|
@ -709,7 +709,7 @@ function NazaraBuild:RegisterModule(moduleTable)
|
||||||
table.insert(moduleTable.Files, "../src/Nazara/" .. moduleTable.Name .. "/**.cpp")
|
table.insert(moduleTable.Files, "../src/Nazara/" .. moduleTable.Name .. "/**.cpp")
|
||||||
|
|
||||||
if (_OPTIONS["united"] and lowerCaseName ~= "core") then
|
if (_OPTIONS["united"] and lowerCaseName ~= "core") then
|
||||||
table.insert(moduleTable.FilesExclusion, "../src/Nazara/" .. moduleTable.Name .. "/Debug/NewOverload.cpp")
|
table.insert(moduleTable.FilesExcluded, "../src/Nazara/" .. moduleTable.Name .. "/Debug/NewOverload.cpp")
|
||||||
end
|
end
|
||||||
|
|
||||||
moduleTable.Type = "Module"
|
moduleTable.Type = "Module"
|
||||||
|
|
@ -804,60 +804,36 @@ function NazaraBuild:Process(infoTable)
|
||||||
end
|
end
|
||||||
infoTable.Libraries = libraries
|
infoTable.Libraries = libraries
|
||||||
|
|
||||||
for platform, defineTable in pairs(infoTable.OsDefines) do
|
for k,v in pairs(infoTable) do
|
||||||
platform = string.lower(platform)
|
local target = k:match("Os(%w+)")
|
||||||
if (platform == "posix") then
|
if (target) then
|
||||||
local osname = os.get()
|
local targetTable = infoTable[target]
|
||||||
if (PosixOSes[osname]) then
|
if (targetTable) then
|
||||||
platform = osname
|
local excludeTargetTable = infoTable[target .. "Excluded"]
|
||||||
end
|
for platform, defineTable in pairs(v) do
|
||||||
end
|
platform = string.lower(platform)
|
||||||
|
if (platform == "posix") then
|
||||||
|
local osname = os.get()
|
||||||
|
if (PosixOSes[osname]) then
|
||||||
|
platform = osname
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
if (os.is(platform)) then
|
if (os.is(platform)) then
|
||||||
for k,v in ipairs(defineTable) do
|
for k,v in ipairs(defineTable) do
|
||||||
table.insert(infoTable.Defines, v)
|
table.insert(targetTable, v)
|
||||||
|
end
|
||||||
|
elseif (excludeTargetTable) then
|
||||||
|
for k,v in ipairs(defineTable) do
|
||||||
|
table.insert(excludeTargetTable, v)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
infoTable[k] = nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
infoTable.OsDefines = nil
|
|
||||||
|
|
||||||
for platform, fileTable in pairs(infoTable.OsFiles) do
|
|
||||||
platform = string.lower(platform)
|
|
||||||
if (platform == "posix") then
|
|
||||||
local osname = os.get()
|
|
||||||
if (PosixOSes[osname]) then
|
|
||||||
platform = osname
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
if (os.is(platform)) then
|
|
||||||
for k,v in ipairs(fileTable) do
|
|
||||||
table.insert(infoTable.Files, v)
|
|
||||||
end
|
|
||||||
else
|
|
||||||
for k,v in ipairs(fileTable) do
|
|
||||||
table.insert(infoTable.FilesExclusion, v)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
infoTable.OsFiles = nil
|
|
||||||
|
|
||||||
for platform, libraryTable in pairs(infoTable.OsLibraries) do
|
|
||||||
platform = string.lower(platform)
|
|
||||||
if (platform == "posix") then
|
|
||||||
local osname = os.get()
|
|
||||||
if (PosixOSes[osname]) then
|
|
||||||
platform = osname
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
if (os.is(platform)) then
|
|
||||||
for k,v in ipairs(libraryTable) do
|
|
||||||
table.insert(infoTable.Libraries, v)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
infoTable.OsLibraries = nil
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function NazaraBuild:SetupInfoTable(infoTable)
|
function NazaraBuild:SetupInfoTable(infoTable)
|
||||||
|
|
@ -866,13 +842,10 @@ function NazaraBuild:SetupInfoTable(infoTable)
|
||||||
infoTable.ConfigurationLibraries.ReleaseStatic = {}
|
infoTable.ConfigurationLibraries.ReleaseStatic = {}
|
||||||
infoTable.ConfigurationLibraries.DebugDynamic = {}
|
infoTable.ConfigurationLibraries.DebugDynamic = {}
|
||||||
infoTable.ConfigurationLibraries.ReleaseDynamic = {}
|
infoTable.ConfigurationLibraries.ReleaseDynamic = {}
|
||||||
infoTable.Defines = {}
|
|
||||||
infoTable.Files = {}
|
local infos = {"Defines", "Files", "FilesExcluded", "Flags", "Includes", "Libraries"}
|
||||||
infoTable.FilesExclusion = {}
|
for k,v in ipairs(infos) do
|
||||||
infoTable.Flags = {}
|
infoTable[v] = {}
|
||||||
infoTable.Includes = {}
|
infoTable["Os" .. v] = {}
|
||||||
infoTable.Libraries = {}
|
end
|
||||||
infoTable.OsDefines = {}
|
|
||||||
infoTable.OsFiles = {}
|
|
||||||
infoTable.OsLibraries = {}
|
|
||||||
end
|
end
|
||||||
|
|
@ -22,7 +22,7 @@ TOOL.Files = {
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Exlude client-only files
|
-- Exlude client-only files
|
||||||
TOOL.FilesExclusion = {
|
TOOL.FilesExcluded = {
|
||||||
"../SDK/**/CameraComponent.*",
|
"../SDK/**/CameraComponent.*",
|
||||||
"../SDK/**/Console.*",
|
"../SDK/**/Console.*",
|
||||||
"../SDK/**/GraphicsComponent.*",
|
"../SDK/**/GraphicsComponent.*",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue