updated nmake2, premake config improvements

This commit is contained in:
Roman Masanin 2023-06-25 13:14:39 +02:00
parent bef7d504ae
commit 80957f895b
2 changed files with 116 additions and 114 deletions

2
nmake2

@ -1 +1 @@
Subproject commit 56f6cfcbc622c6cfeed2e4a8abb66f28d3f0d303 Subproject commit 3d04ffed77947de5c16c044f4c1e47c812ba3ec6

View File

@ -1,19 +1,13 @@
--import .mak file generation module
--require("nmake")
require("nmake2") require("nmake2")
newoption {
trigger = "with-lto",
description = "Build with link time optimization"
}
workspace "isle" workspace "isle"
language "C++" language "C++"
configurations { "Debug", "Release" } configurations { "Debug", "Release" }
startproject "isle" startproject "isle"
location "build" location "build"
symbols "Full" symbols "Full"
warnings "Extra" warnings "Extra" --flag /W3 or /W4
symbols "on" symbols "on"
filter { "system:windows" } filter { "system:windows" }
@ -48,15 +42,17 @@ workspace "isle"
"macosx-amd64", "macosx-amd64",
} }
filter "configurations:Debug" filter { "configurations:Vanilla" }
defines { "DEBUG" } defines { "VANILLA_DEFINES" }
filter "configurations:not Debug" filter { "configurations:Debug" }
--TODO: check if "DEBUG" define is also needed
defines { "_DEBUG" }
optimize "debug"
filter { "configurations:not Debug" }
defines { "NDEBUG" } defines { "NDEBUG" }
optimize "Speed" optimize "Speed"
if(_OPTIONS["with-lto"]) then
flags { "LinkTimeOptimization" }
end
filter { "platforms:win*" } filter { "platforms:win*" }
system "windows" system "windows"
@ -102,35 +98,45 @@ end
project "isle" project "isle"
kind "WindowedApp" kind "WindowedApp"
targetname "isle" targetname "ISLE"
targetdir "bin/%{cfg.platform}/%{cfg.buildcfg}" targetdir "bin/%{cfg.platform}/%{cfg.buildcfg}"
links { "lego1" } links { "lego1" }
resincludedirs { "." } resincludedirs { "." }
dependson { "lego1" } dependson { "lego1" }
staticruntime "libc"
--libdirs { "bin/%{cfg.platform}/%{cfg.buildcfg}" }
files { addSrcFiles("ISLE") } files { addSrcFiles("ISLE") }
files { addSrcFiles("ISLE/res") } files { addSrcFiles("ISLE/res") }
includedirs { "LEGO1" } includedirs { "LEGO1" }
filter { "action:nmake2" }
--flag /ML or /MLd
staticruntime "libc"
filter { "action:not nmake2" }
--flag /MT or /MTd
staticruntime "on"
filter { "platforms:win*" } filter { "platforms:win*" }
links { "dsound", "advapi32", "user32", "Gdi32", "Winmm" } links { "dsound", "advapi32", "user32", "gdi32", "winmm" }
--flag language for rc.exe
resoptions { "/l 0x409" } resoptions { "/l 0x409" }
filter "configurations:Vanilla" --this flags looks like default on,
defines { "VANILLA_DEFINES" } --but still need some tweaks to nmake2 module to make sure it active
--filter { "configurations:Debug" }
-- buildoptions { "/Gm" }
-- linkoptions { "/incremental:yes" }
--reset all filters
filter {} filter {}
project "lego1" project "lego1"
--TODO: create mxomni project and make static linking configuration
--kind "StaticLib" --kind "StaticLib"
kind "SharedLib" kind "SharedLib"
targetname "lego1" targetname "LEGO1"
targetdir "bin/%{cfg.platform}/%{cfg.buildcfg}" targetdir "bin/%{cfg.platform}/%{cfg.buildcfg}"
--flag /MT or /MTd
staticruntime "on" staticruntime "on"
files { addSrcFiles("LEGO1") } files { addSrcFiles("LEGO1") }
@ -138,8 +144,4 @@ project "lego1"
filter { "platforms:win*" } filter { "platforms:win*" }
links { "dsound", "advapi32", "user32", "Gdi32", "Winmm" } links { "dsound", "advapi32", "user32", "Gdi32", "Winmm" }
filter "configurations:Vanilla"
defines { "VANILLA_DEFINES" }
filter {} filter {}