Build: Add support for OS-specific defines

Former-commit-id: 7181f755cfc2640e862e496db96909fdbe485072
This commit is contained in:
Lynix 2016-04-29 09:03:05 +02:00
parent 0d6727e746
commit 95cb384897
1 changed files with 18 additions and 0 deletions

View File

@ -787,6 +787,23 @@ function NazaraBuild:Process(infoTable)
end
infoTable.Libraries = libraries
for platform, defineTable in pairs(infoTable.OsDefines) 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(defineTable) do
table.insert(infoTable.Defines, v)
end
end
end
infoTable.OsDefines = nil
for platform, fileTable in pairs(infoTable.OsFiles) do
platform = string.lower(platform)
if (platform == "posix") then
@ -838,6 +855,7 @@ function NazaraBuild:SetupInfoTable(infoTable)
infoTable.Flags = {}
infoTable.Includes = {}
infoTable.Libraries = {}
infoTable.OsDefines = {}
infoTable.OsFiles = {}
infoTable.OsLibraries = {}
end