Build/Boilerplate/workspace.lua
Reece 100644b0de [+] Static dependencies no longer link agasint things they shouldn't
[+] Nonstatic entities
[+] Build order is not perserved anymore for UX. Namespaces are ordered more neatly now
[*] Bug fixes in platform guess and remove code
2021-06-18 00:58:12 +01:00

121 lines
3.7 KiB
Lua

local toolPlatforms = {"win32", "linux"}
-------------------------------------------------------
-- build platform
-------------------------------------------------------
local isWin = _G.win32
local isToolChain = false
for k in pairs(toolPlatforms) do
if (_G[toolPlatforms[k]]) then
isToolChain = true
end
end
printHeader("configuration", "platforms")
print("isWin", isWin)
print("isDevelopmentPlatform", isToolChain)
print()
-------------------------------------------------------
-- create workspace
-------------------------------------------------------
local target = require("platform")
workspace "Aurora Project"
configurations { "Debug", "Release", "Ship" }
platforms(target)
architecture(target[1])
location(getroot() .. "/Build_CompilerWorkingDirectory/")
symbols "On"
staticruntime "On"
visibility "Hidden"
editandcontinue "Off"
flags
{
"NoPCH",
"MultiProcessorCompile"
}
filter "configurations:Debug"
defines { "DEBUG" }
targetdir(getroot() .. "/Build_CompilerWorkingDirectory/Bin/Debug")
debugdir( getroot() .. "/Build_Develop")
flags "NoIncrementalLink"
filter "configurations:Release or configurations:Ship"
defines { "NDEBUG" }
optimize "Speed"
filter "configurations:Release"
defines {"INTERNAL", "STAGING"}
targetdir(getroot() .. "/Build_CompilerWorkingDirectory/Bin/Release")
debugdir(getroot() .. "/Build_Stage")
flags "NoIncrementalLink"
filter "configurations:Ship"
defines {"SHIP"}
targetdir(getroot() .. "/Build_CompilerWorkingDirectory/Bin/Ship")
debugdir(getroot() .. "/Build_Ship")
flags "LinkTimeOptimization"
filter {}
stringpooling "true"
floatingpoint "strict"
if ((not isWin) or (_G.forceClang)) then
usingClang = true
toolset "clang"
buildoptions {"-fms-extensions"}
filter {"files:**.cpp or files:**.cc"}
buildoptions {"-stdlib=libc++"}
filter {}
disablewarnings
{
-- we live life on the edge
"unused-result",
-- warning: unused unused enumeration
"unused-value",
"unknown-warning-option"
}
elseif (isWin) then
usingMSVC = true
disablewarnings
{
"4996", -- The whiny C99 is no longer supported nag
-- please needlessly use '_s' and '_'d functions __error__
-- fuck off
"4251", -- MSVC's hurrdurr abis will break if you dynamically link classes
-- counter: fuck off again. we have full control of the build process, and we only link against
-- dynamic c/stl runtimes. which brainlet thought this was a good idea?
-- even microsofts docs dont state what is guaranteed to be safe.
-- dont mix optimizations, cookie/security flags, and so on. rtti works so who cares
"4244" -- conversion from 'double' to 'float', possible loss of data
-- this warning is extremely important; however, we're making a game engine.
-- pragma warning push + disable + pop and/or static_casts to hint we expect floating point precision
-- loss is extremely annoying and impractical. further, projects including harfbuzz, freetype,
-- and v8 don't seem to care about this warning either
}
end
if (usingClang or usingMSVC) then
defines "_AU_HAS_ATOMIC_INTRINS"
end
if (isWin) then
-- yeaaa, no
defines "_CRT_SECURE_NO_WARNINGS"
end