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