Refactor premake scripts.
This commit is contained in:
parent
e348cacc6d
commit
2a076c924f
48
premake5.lua
48
premake5.lua
|
@ -24,6 +24,9 @@ defines({
|
|||
"UNICODE",
|
||||
})
|
||||
|
||||
cppdialect("C++17")
|
||||
symbols("On")
|
||||
|
||||
-- TODO(DrChat): Find a way to disable this on other architectures.
|
||||
if ARCH ~= "ppc64" then
|
||||
filter("architecture:x86_64")
|
||||
|
@ -44,30 +47,29 @@ filter("kind:StaticLib")
|
|||
|
||||
filter("configurations:Checked")
|
||||
runtime("Debug")
|
||||
optimize("Off")
|
||||
defines({
|
||||
"DEBUG",
|
||||
})
|
||||
runtime("Debug")
|
||||
filter({"configurations:Checked", "platforms:Windows"})
|
||||
buildoptions({
|
||||
"/RTCsu", -- Full Run-Time Checks.
|
||||
"/RTCsu", -- Full Run-Time Checks.
|
||||
})
|
||||
filter({"configurations:Checked", "platforms:Linux"})
|
||||
defines({
|
||||
"_GLIBCXX_DEBUG", -- libstdc++ debug mode
|
||||
})
|
||||
|
||||
filter("configurations:Debug")
|
||||
runtime("Debug")
|
||||
runtime("Release")
|
||||
optimize("Off")
|
||||
defines({
|
||||
"DEBUG",
|
||||
"_NO_DEBUG_HEAP=1",
|
||||
})
|
||||
runtime("Release")
|
||||
filter({"configurations:Debug", "platforms:Windows"})
|
||||
linkoptions({
|
||||
"/NODEFAULTLIB:MSVCRTD",
|
||||
})
|
||||
|
||||
filter({"configurations:Debug", "platforms:Linux"})
|
||||
buildoptions({
|
||||
"-g",
|
||||
defines({
|
||||
"_GLIBCXX_DEBUG", -- make dbg symbols work on some distros
|
||||
})
|
||||
|
||||
filter("configurations:Release")
|
||||
|
@ -76,25 +78,18 @@ filter("configurations:Release")
|
|||
"NDEBUG",
|
||||
"_NO_DEBUG_HEAP=1",
|
||||
})
|
||||
optimize("speed")
|
||||
optimize("Speed")
|
||||
inlining("Auto")
|
||||
floatingpoint("Fast")
|
||||
flags({
|
||||
"LinkTimeOptimization",
|
||||
})
|
||||
runtime("Release")
|
||||
filter({"configurations:Release", "platforms:Windows"})
|
||||
linkoptions({
|
||||
"/NODEFAULTLIB:MSVCRTD",
|
||||
})
|
||||
|
||||
filter("platforms:Linux")
|
||||
system("linux")
|
||||
toolset("clang")
|
||||
cppdialect("C++17")
|
||||
buildoptions({
|
||||
-- "-mlzcnt", -- (don't) Assume lzcnt is supported.
|
||||
"`pkg-config --cflags gtk+-x11-3.0`",
|
||||
({os.outputof("pkg-config --cflags gtk+-x11-3.0")})[1],
|
||||
"-fno-lto", -- Premake doesn't support LTO on clang
|
||||
})
|
||||
links({
|
||||
|
@ -105,14 +100,13 @@ filter("platforms:Linux")
|
|||
"rt",
|
||||
})
|
||||
linkoptions({
|
||||
"`pkg-config --libs gtk+-3.0`",
|
||||
({os.outputof("pkg-config --libs gtk+-3.0")})[1],
|
||||
})
|
||||
|
||||
filter({"platforms:Linux", "kind:*App"})
|
||||
linkgroups("On")
|
||||
|
||||
filter({"platforms:Linux", "language:C++", "toolset:gcc"})
|
||||
cppdialect("C++17")
|
||||
links({
|
||||
})
|
||||
disablewarnings({
|
||||
|
@ -147,13 +141,11 @@ filter({"platforms:Linux", "language:C++", "toolset:clang", "files:*.cc or *.cpp
|
|||
filter("platforms:Windows")
|
||||
system("windows")
|
||||
toolset("msc")
|
||||
cppdialect("C++17")
|
||||
buildoptions({
|
||||
"/MP", -- Multiprocessor compilation.
|
||||
"/utf-8", -- 'build correctly on systems with non-Latin codepages'.
|
||||
-- Mark warnings as severe
|
||||
"/w14839", -- non-standard use of class 'type' as an argument to a variadic function
|
||||
"/w14840", -- non-portable use of class 'type' as an argument to a variadic function
|
||||
"/w14839", -- non-standard use of class 'type' as an argument to a variadic function
|
||||
"/w14840", -- non-portable use of class 'type' as an argument to a variadic function
|
||||
-- Disable warnings
|
||||
"/wd4100", -- Unreferenced parameters are ok.
|
||||
"/wd4201", -- Nameless struct/unions are ok.
|
||||
|
@ -163,10 +155,10 @@ filter("platforms:Windows")
|
|||
"/wd4189", -- 'local variable is initialized but not referenced'.
|
||||
})
|
||||
flags({
|
||||
"NoMinimalRebuild", -- Required for /MP above.
|
||||
"MultiProcessorCompile", -- Multiprocessor compilation.
|
||||
"NoMinimalRebuild", -- Required for /MP above.
|
||||
})
|
||||
|
||||
symbols("On")
|
||||
defines({
|
||||
"_CRT_NONSTDC_NO_DEPRECATE",
|
||||
"_CRT_SECURE_NO_WARNINGS",
|
||||
|
|
|
@ -18,7 +18,7 @@ project("SDL2")
|
|||
"SDL2/include",
|
||||
})
|
||||
buildoptions({
|
||||
"/wd4828", -- illegal characters in file
|
||||
"/wd4828", -- illegal characters in file https://bugzilla.libsdl.org/show_bug.cgi?id=5333
|
||||
})
|
||||
files({
|
||||
-- 1:1 from SDL.vcxproj file
|
||||
|
|
|
@ -73,4 +73,4 @@ project("spirv-tools")
|
|||
buildoptions({
|
||||
"/wd4800", -- Forcing value to bool 'true' or 'false'
|
||||
"/wd4996", -- Call to 'std::equal' with parameters that may be unsafe
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue