Fix Linux linking issues

This commit is contained in:
Lynix 2020-02-24 20:57:06 +01:00
parent 2154782840
commit d298e93c13
1 changed files with 35 additions and 13 deletions

View File

@ -89,7 +89,7 @@ function NazaraBuild:Execute()
for k, libTable in ipairs(self.OrderedExtLibs) do for k, libTable in ipairs(self.OrderedExtLibs) do
project(libTable.Name) project(libTable.Name)
self:PrepareGeneric() self:PreconfigGenericProject()
language(libTable.Language) language(libTable.Language)
location(_ACTION .. "/thirdparty") location(_ACTION .. "/thirdparty")
@ -126,6 +126,8 @@ function NazaraBuild:Execute()
end end
filter({}) filter({})
self:PostconfigGenericProject()
end end
end end
@ -135,14 +137,14 @@ function NazaraBuild:Execute()
if (_OPTIONS["united"]) then if (_OPTIONS["united"]) then
project("NazaraEngine") project("NazaraEngine")
self:PrepareMainWorkspace() self:PreconfigNazaraProject()
end end
for k, moduleTable in ipairs(self.OrderedModules) do for k, moduleTable in ipairs(self.OrderedModules) do
if (not _OPTIONS["united"]) then if (not _OPTIONS["united"]) then
project("Nazara" .. moduleTable.Name) project("Nazara" .. moduleTable.Name)
self:PrepareMainWorkspace() self:PreconfigNazaraProject()
end end
location(_ACTION .. "/modules") location(_ACTION .. "/modules")
@ -184,6 +186,14 @@ function NazaraBuild:Execute()
end end
filter({}) filter({})
if (not _OPTIONS["united"]) then
self:PostconfigNazaraProject()
end
end
if (_OPTIONS["united"]) then
self:PostconfigNazaraProject()
end end
-- Tools -- Tools
@ -197,7 +207,7 @@ function NazaraBuild:Execute()
project(prefix .. toolTable.Name) project(prefix .. toolTable.Name)
self:PrepareMainWorkspace() self:PreconfigNazaraProject()
location(_ACTION .. "/tools") location(_ACTION .. "/tools")
@ -255,6 +265,8 @@ function NazaraBuild:Execute()
end end
filter({}) filter({})
self:PostconfigNazaraProject()
end end
group("Examples") group("Examples")
@ -264,7 +276,7 @@ function NazaraBuild:Execute()
project("Demo" .. exampleTable.Name) project("Demo" .. exampleTable.Name)
self:PrepareMainWorkspace() self:PreconfigNazaraProject()
location(_ACTION .. "/examples") location(_ACTION .. "/examples")
@ -305,6 +317,8 @@ function NazaraBuild:Execute()
end end
filter({}) filter({})
self:PostconfigNazaraProject()
end end
end end
end end
@ -806,7 +820,7 @@ function NazaraBuild:Process(infoTable)
return true return true
end end
function NazaraBuild:PrepareGeneric() function NazaraBuild:PreconfigGenericProject()
flags({ flags({
"MultiProcessorCompile", "MultiProcessorCompile",
"NoMinimalRebuild", "NoMinimalRebuild",
@ -871,18 +885,22 @@ function NazaraBuild:PrepareGeneric()
buildoptions("-mfpmath=sse") buildoptions("-mfpmath=sse")
buildoptions("-ftree-vectorize") buildoptions("-ftree-vectorize")
-- Add options required for C++17 thread and filesystem
filter("action:gmake*")
links("stdc++fs")
links("pthread")
filter({}) filter({})
buildoptions(self.Config["AdditionalCompilationOptions"]) buildoptions(self.Config["AdditionalCompilationOptions"])
end end
function NazaraBuild:PrepareMainWorkspace() function NazaraBuild:PostconfigGenericProject()
self:PrepareGeneric() -- Add options required for C++17 thread and filesystem (have to be linked last)
filter("action:gmake*")
links("stdc++fs")
links("pthread")
filter({})
end
function NazaraBuild:PreconfigNazaraProject()
self:PreconfigGenericProject()
language("C++") language("C++")
@ -916,6 +934,10 @@ function NazaraBuild:PrepareMainWorkspace()
filter({}) filter({})
end end
function NazaraBuild:PostconfigNazaraProject()
self:PostconfigGenericProject()
end
function NazaraBuild:RegisterAction(actionTable) function NazaraBuild:RegisterAction(actionTable)
if (not actionTable.Manual) then if (not actionTable.Manual) then
if (actionTable.Name == nil or type(actionTable.Name) ~= "string" or string.len(actionTable.Name) == 0) then if (actionTable.Name == nil or type(actionTable.Name) ~= "string" or string.len(actionTable.Name) == 0) then