Build/Core/solution.lua
2023-12-19 06:01:14 +00:00

87 lines
2.6 KiB
Lua

local function auStartSolution(sln)
workspace(sln.name)
auRequire("Core/Target").startSolution()
location(Aurora.Settings.sAbsCompilerWd)
-- Required for core Aurora assumptions. External build chains may mess with these -- not my problem.
symbols "On" -- even ship binaries are initially built with symbols for unix targets to strip them with objcopy
visibility "Hidden" -- posix devs are stupid. default vis is stupid. we're beyond the 70's C OS aka version 7 UNIX
stringpooling "true" -- i've seen hashmaps explode too many times to care about the few ms this saves
floatingpoint "strict" -- x87 sucks so lets be mean. it's a nice to have when working with js runtimes
justmycode "Off" -- some premake warning bug
if (Aurora.Settings.bStaticRuntime) then
staticruntime "On"
else
staticruntime "Off"
end
if (Aurora.Settings.bEditAndCont) then
editandcontinue "On"
else
editandcontinue "Off"
end
flags
{
"NoPCH"
}
if (Aurora.Settings.bMultithreadBuild) then
flags
{
"MultiProcessorCompile"
}
end
if (Aurora.Settings.bLTO) then
flags "LinkTimeOptimization"
end
auFilterForPlatforms(function(platform)
if (platform == "win32") then
if (not Aurora.Settings.bForceClangWin32) then
toolset "msc"
else
toolset "clang"
end
else
if (not Aurora.Settings.bForceClangOnUnix) then
toolset "gcc"
else
toolset "clang"
end
end
end)
local gmakeOnWin32 = os.host() == "windows" and _ACTION == "gmake2"
if (Aurora.Settings.bForceLLVMStl and not gmakeOnWin32) then
auFilter {"files:**.cpp or files:**.cc or files:**.cxx", "toolset:clang"}
buildoptions {"-stdlib=libc++"}
auFilter{}
auFilter { "toolset:clang"}
linkoptions {"-nodefaultlibs"}
links {
"m",
"c",
"gcc_s",
"gcc"
}
if (Aurora.Settings.bStaticRuntime) then
links {
"c++",
"c++abi"
}
end
auFilter {}
end
end
return {
start = auStartSolution
}