From 1def3ea22eba727c8d845cd9d1f742d621fc6b6c Mon Sep 17 00:00:00 2001 From: Jason Ly Date: Mon, 29 Dec 2025 16:30:45 -0500 Subject: [PATCH] premake for debug and release --- premake5.lua | 98 +++++++++++----------------------------------------- 1 file changed, 21 insertions(+), 77 deletions(-) diff --git a/premake5.lua b/premake5.lua index def8e24..56834b9 100644 --- a/premake5.lua +++ b/premake5.lua @@ -122,6 +122,26 @@ workspace "efsw" configurations { "debug", "release", "relwithdbginfo" } platforms { "x86_64", "x86", "ARM", "ARM64" } + -- GLOBAL CONFIGURATION (Applies to ALL projects below) + filter "configurations:debug" + defines { "DEBUG" } + symbols "On" + runtime "Debug" -- This forces /MDd everywhere + + filter "configurations:release" + defines { "NDEBUG" } + optimize "On" + runtime "Release" -- This forces /MD everywhere + + filter "configurations:relwithdbginfo" + defines { "NDEBUG" } + symbols "On" + optimize "On" + runtime "Release" + + -- Reset filter so project-specific settings work + filter "*" + if os.istarget("windows") then osfiles = "src/efsw/platform/win/*.cpp" else @@ -155,26 +175,7 @@ workspace "efsw" targetdir("./lib") includedirs { "include", "src" } files { "src/efsw/*.cpp", osfiles } - conf_excludes() - - filter "configurations:debug" - defines { "DEBUG" } - symbols "On" - targetname "efsw-static-debug" - conf_warnings() - - filter "configurations:release" - defines { "NDEBUG" } - optimize "On" - targetname "efsw-static-release" - conf_warnings() - - filter "configurations:relwithdbginfo" - defines { "NDEBUG" } - symbols "On" - optimize "On" - targetname "efsw-static-reldbginfo" - conf_warnings() + conf_excludes() project "efsw-test" kind "ConsoleApp" @@ -183,25 +184,6 @@ workspace "efsw" files { "src/test/efsw-test.cpp" } includedirs { "include", "src" } conf_links() - - filter "configurations:debug" - defines { "DEBUG" } - symbols "On" - targetname "efsw-test-debug" - conf_warnings() - - filter "configurations:release" - defines { "NDEBUG" } - optimize "On" - targetname "efsw-test-release" - conf_warnings() - - filter "configurations:relwithdbginfo" - defines { "NDEBUG" } - symbols "On" - optimize "On" - targetname "efsw-test-reldbginfo" - conf_warnings() project "joomer-efsw-file-monitoring" kind "ConsoleApp" @@ -219,25 +201,6 @@ workspace "efsw" includedirs { "include", "src" } conf_links() - filter "configurations:debug" - defines { "DEBUG" } - symbols "On" - targetname "efsw-test-stdc-debug" - conf_warnings() - - filter "configurations:release" - defines { "NDEBUG" } - optimize "On" - targetname "efsw-test-stdc-release" - conf_warnings() - - filter "configurations:relwithdbginfo" - defines { "NDEBUG" } - symbols "On" - optimize "On" - targetname "efsw-test-stdc-reldbginfo" - conf_warnings() - project "efsw-shared-lib" kind "SharedLib" language "C++" @@ -248,25 +211,6 @@ workspace "efsw" conf_excludes() conf_links() - filter "configurations:debug" - defines { "DEBUG" } - symbols "On" - targetname "efsw-debug" - conf_warnings() - - filter "configurations:release" - defines { "NDEBUG" } - optimize "On" - targetname "efsw" - conf_warnings() - - filter "configurations:relwithdbginfo" - defines { "NDEBUG" } - symbols "On" - optimize "On" - targetname "efsw" - conf_warnings() - if os.istarget("linux") or os.istarget("bsd") or os.istarget("haiku") then targetextension ( ".so." .. efsw_version ) postbuildcommands { "sh ../../project/build.reldbginfo.sh " .. efsw_major_version .. " " .. efsw_minor_version .. " " .. efsw_patch_version .. " " .. iif( _OPTIONS["strip-symbols"], "strip-symbols", "" ) }