Build: Fix some premake5 weirdness
It seems some options are global and other local to the workspace (flags and buildoptions could be defined outside of the workspace, defines couldn't)
This commit is contained in:
parent
9e9b01eff5
commit
6500d088e9
|
|
@ -42,7 +42,6 @@ function NazaraBuild:Execute()
|
||||||
return -- Alors l'utilisateur voulait probablement savoir comment utiliser le programme, on ne fait rien
|
return -- Alors l'utilisateur voulait probablement savoir comment utiliser le programme, on ne fait rien
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
local clangGccActions = "action:" .. table.concat({"codeblocks", "codelite", "gmake", "xcode3", "xcode4"}, " or ")
|
local clangGccActions = "action:" .. table.concat({"codeblocks", "codelite", "gmake", "xcode3", "xcode4"}, " or ")
|
||||||
|
|
||||||
local platformData
|
local platformData
|
||||||
|
|
@ -52,59 +51,6 @@ function NazaraBuild:Execute()
|
||||||
platformData = {"x86", "x64"}
|
platformData = {"x86", "x64"}
|
||||||
end
|
end
|
||||||
|
|
||||||
flags({
|
|
||||||
"C++14",
|
|
||||||
"MultiProcessorCompile",
|
|
||||||
"NoMinimalRebuild"
|
|
||||||
})
|
|
||||||
|
|
||||||
self:FilterLibDirectory("../extlibs/lib/", libdirs)
|
|
||||||
|
|
||||||
-- Fixes Premake stuff
|
|
||||||
filter({"kind:SharedLib", clangGccActions})
|
|
||||||
implibprefix("lib")
|
|
||||||
filter({"kind:*Lib", clangGccActions, "system:Windows"})
|
|
||||||
implibextension(".a")
|
|
||||||
filter({"kind:StaticLib", clangGccActions})
|
|
||||||
targetextension(".a")
|
|
||||||
targetprefix("lib")
|
|
||||||
|
|
||||||
-- General configuration
|
|
||||||
filter("kind:*Lib")
|
|
||||||
pic("On")
|
|
||||||
|
|
||||||
filter({"kind:*Lib", "configurations:DebugStatic"})
|
|
||||||
targetsuffix("-s-d")
|
|
||||||
|
|
||||||
filter({"kind:*Lib", "configurations:ReleaseStatic"})
|
|
||||||
targetsuffix("-s")
|
|
||||||
|
|
||||||
filter({"kind:*Lib", "configurations:DebugDynamic"})
|
|
||||||
targetsuffix("-d")
|
|
||||||
|
|
||||||
filter("configurations:Debug*")
|
|
||||||
symbols("On")
|
|
||||||
|
|
||||||
-- Setup some optimizations for release
|
|
||||||
filter("configurations:Release*")
|
|
||||||
flags("NoFramePointer")
|
|
||||||
optimize("Speed")
|
|
||||||
rtti("Off")
|
|
||||||
vectorextensions("SSE2")
|
|
||||||
|
|
||||||
filter("configurations:*Static")
|
|
||||||
kind("StaticLib")
|
|
||||||
|
|
||||||
filter("configurations:*Dynamic")
|
|
||||||
kind("SharedLib")
|
|
||||||
|
|
||||||
-- Enable SSE math and vectorization optimizations
|
|
||||||
filter({"configurations:Release*", clangGccActions})
|
|
||||||
buildoptions("-mfpmath=sse")
|
|
||||||
buildoptions("-ftree-vectorize")
|
|
||||||
|
|
||||||
filter({})
|
|
||||||
|
|
||||||
if (self.Actions[_ACTION] == nil) then
|
if (self.Actions[_ACTION] == nil) then
|
||||||
if (self.Config["BuildDependencies"]) then
|
if (self.Config["BuildDependencies"]) then
|
||||||
workspace("NazaraExtlibs")
|
workspace("NazaraExtlibs")
|
||||||
|
|
@ -116,6 +62,7 @@ function NazaraBuild:Execute()
|
||||||
"ReleaseStatic"
|
"ReleaseStatic"
|
||||||
})
|
})
|
||||||
|
|
||||||
|
self:PrepareGeneric()
|
||||||
self:FilterLibDirectory("../extlibs/lib/", targetdir)
|
self:FilterLibDirectory("../extlibs/lib/", targetdir)
|
||||||
|
|
||||||
filter(clangGccActions)
|
filter(clangGccActions)
|
||||||
|
|
@ -157,29 +104,15 @@ function NazaraBuild:Execute()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- General settings
|
|
||||||
filter("architecture:x86_64")
|
|
||||||
defines("NAZARA_PLATFORM_x64")
|
|
||||||
|
|
||||||
filter("configurations:Debug*")
|
|
||||||
defines("NAZARA_DEBUG")
|
|
||||||
|
|
||||||
filter("configurations:*Static")
|
|
||||||
defines("NAZARA_STATIC")
|
|
||||||
|
|
||||||
filter("kind:*Lib")
|
|
||||||
defines("NAZARA_BUILD")
|
|
||||||
|
|
||||||
filter({"system:not Windows", clangGccActions})
|
|
||||||
buildoptions("-fvisibility=hidden")
|
|
||||||
|
|
||||||
-- Add lib/conf/arch to library search path
|
|
||||||
self:FilterLibDirectory("../lib/", libdirs)
|
|
||||||
|
|
||||||
-- Start defining projects
|
-- Start defining projects
|
||||||
workspace("NazaraEngine")
|
workspace("NazaraEngine")
|
||||||
platforms(platformData)
|
platforms(platformData)
|
||||||
|
|
||||||
|
self:PrepareMainWorkspace()
|
||||||
|
|
||||||
|
-- Add lib/conf/arch to library search path
|
||||||
|
self:FilterLibDirectory("../lib/", libdirs)
|
||||||
|
|
||||||
configurations({
|
configurations({
|
||||||
-- "DebugStatic",
|
-- "DebugStatic",
|
||||||
-- "ReleaseStatic",
|
-- "ReleaseStatic",
|
||||||
|
|
@ -757,6 +690,82 @@ function NazaraBuild:Process(infoTable)
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function NazaraBuild:PrepareGeneric()
|
||||||
|
flags({
|
||||||
|
"C++14",
|
||||||
|
"MultiProcessorCompile",
|
||||||
|
"NoMinimalRebuild"
|
||||||
|
})
|
||||||
|
|
||||||
|
self:FilterLibDirectory("../extlibs/lib/", libdirs)
|
||||||
|
|
||||||
|
-- Fixes Premake stuff
|
||||||
|
filter({"kind:SharedLib", clangGccActions})
|
||||||
|
implibprefix("lib")
|
||||||
|
filter({"kind:*Lib", clangGccActions, "system:Windows"})
|
||||||
|
implibextension(".a")
|
||||||
|
filter({"kind:StaticLib", clangGccActions})
|
||||||
|
targetextension(".a")
|
||||||
|
targetprefix("lib")
|
||||||
|
|
||||||
|
-- General configuration
|
||||||
|
filter("kind:*Lib")
|
||||||
|
pic("On")
|
||||||
|
|
||||||
|
filter({"kind:*Lib", "configurations:DebugStatic"})
|
||||||
|
targetsuffix("-s-d")
|
||||||
|
|
||||||
|
filter({"kind:*Lib", "configurations:ReleaseStatic"})
|
||||||
|
targetsuffix("-s")
|
||||||
|
|
||||||
|
filter({"kind:*Lib", "configurations:DebugDynamic"})
|
||||||
|
targetsuffix("-d")
|
||||||
|
|
||||||
|
filter("configurations:Debug*")
|
||||||
|
symbols("On")
|
||||||
|
|
||||||
|
-- Setup some optimizations for release
|
||||||
|
filter("configurations:Release*")
|
||||||
|
flags("NoFramePointer")
|
||||||
|
optimize("Speed")
|
||||||
|
rtti("Off")
|
||||||
|
vectorextensions("SSE2")
|
||||||
|
|
||||||
|
filter("configurations:*Static")
|
||||||
|
kind("StaticLib")
|
||||||
|
|
||||||
|
filter("configurations:*Dynamic")
|
||||||
|
kind("SharedLib")
|
||||||
|
|
||||||
|
-- Enable SSE math and vectorization optimizations
|
||||||
|
filter({"configurations:Release*", clangGccActions})
|
||||||
|
buildoptions("-mfpmath=sse")
|
||||||
|
buildoptions("-ftree-vectorize")
|
||||||
|
|
||||||
|
filter({})
|
||||||
|
end
|
||||||
|
|
||||||
|
function NazaraBuild:PrepareMainWorkspace()
|
||||||
|
self:PrepareGeneric()
|
||||||
|
|
||||||
|
filter("architecture:x86_64")
|
||||||
|
defines("NAZARA_PLATFORM_x64")
|
||||||
|
|
||||||
|
filter("configurations:Debug*")
|
||||||
|
defines("NAZARA_DEBUG")
|
||||||
|
|
||||||
|
filter("configurations:*Static")
|
||||||
|
defines("NAZARA_STATIC")
|
||||||
|
|
||||||
|
filter("kind:*Lib")
|
||||||
|
defines("NAZARA_BUILD")
|
||||||
|
|
||||||
|
filter({"system:not Windows", clangGccActions})
|
||||||
|
buildoptions("-fvisibility=hidden")
|
||||||
|
|
||||||
|
filter({})
|
||||||
|
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
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue