diff --git a/premake5.lua b/premake5.lua index 22f1fa7f1..7e9f590b2 100644 --- a/premake5.lua +++ b/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", diff --git a/third_party/SDL2-static.lua b/third_party/SDL2-static.lua index a9206e300..447ceb325 100644 --- a/third_party/SDL2-static.lua +++ b/third_party/SDL2-static.lua @@ -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 diff --git a/third_party/spirv-tools.lua b/third_party/spirv-tools.lua index bf900a6e9..0e6335b98 100644 --- a/third_party/spirv-tools.lua +++ b/third_party/spirv-tools.lua @@ -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 - }) \ No newline at end of file + })