mirror of
https://github.com/isledecomp/isle.git
synced 2026-01-22 07:41:16 +00:00
updated nmake2, premake config improvements
This commit is contained in:
parent
bef7d504ae
commit
80957f895b
2
nmake2
2
nmake2
@ -1 +1 @@
|
|||||||
Subproject commit 56f6cfcbc622c6cfeed2e4a8abb66f28d3f0d303
|
Subproject commit 3d04ffed77947de5c16c044f4c1e47c812ba3ec6
|
||||||
216
premake5.lua
216
premake5.lua
@ -1,145 +1,147 @@
|
|||||||
|
--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" }
|
||||||
configurations { "Vanilla" }
|
configurations { "Vanilla" }
|
||||||
defines { "WIN32", "_WINDOWS" }
|
defines { "WIN32", "_WINDOWS" }
|
||||||
platforms {
|
platforms {
|
||||||
"win-x86",
|
"win-x86",
|
||||||
"win-amd64",
|
"win-amd64",
|
||||||
"win-arm",
|
"win-arm",
|
||||||
"win-arm64"
|
"win-arm64"
|
||||||
}
|
}
|
||||||
|
|
||||||
filter { "system:linux" }
|
filter { "system:linux" }
|
||||||
platforms {
|
platforms {
|
||||||
"linux-x86",
|
"linux-x86",
|
||||||
"linux-amd64",
|
"linux-amd64",
|
||||||
"linux-arm",
|
"linux-arm",
|
||||||
"linux-arm64",
|
"linux-arm64",
|
||||||
}
|
}
|
||||||
|
|
||||||
filter { "system:bsd" }
|
filter { "system:bsd" }
|
||||||
platforms {
|
platforms {
|
||||||
"bsd-x86",
|
"bsd-x86",
|
||||||
"bsd-amd64",
|
"bsd-amd64",
|
||||||
"bsd-arm",
|
"bsd-arm",
|
||||||
"bsd-arm64"
|
"bsd-arm64"
|
||||||
}
|
}
|
||||||
|
|
||||||
filter { "system:macosx" }
|
filter { "system:macosx" }
|
||||||
platforms {
|
platforms {
|
||||||
"macosx-arm64",
|
"macosx-arm64",
|
||||||
"macosx-amd64",
|
"macosx-amd64",
|
||||||
}
|
}
|
||||||
|
|
||||||
filter "configurations:Debug"
|
filter { "configurations:Vanilla" }
|
||||||
defines { "DEBUG" }
|
defines { "VANILLA_DEFINES" }
|
||||||
|
|
||||||
filter "configurations:not Debug"
|
filter { "configurations:Debug" }
|
||||||
defines { "NDEBUG" }
|
--TODO: check if "DEBUG" define is also needed
|
||||||
optimize "Speed"
|
defines { "_DEBUG" }
|
||||||
if(_OPTIONS["with-lto"]) then
|
optimize "debug"
|
||||||
flags { "LinkTimeOptimization" }
|
|
||||||
end
|
|
||||||
|
|
||||||
filter { "platforms:win*" }
|
filter { "configurations:not Debug" }
|
||||||
system "windows"
|
defines { "NDEBUG" }
|
||||||
|
optimize "Speed"
|
||||||
|
|
||||||
filter { "platforms:linux*" }
|
filter { "platforms:win*" }
|
||||||
system "linux"
|
system "windows"
|
||||||
|
|
||||||
filter { "platforms:bsd*" }
|
filter { "platforms:linux*" }
|
||||||
system "bsd"
|
system "linux"
|
||||||
|
|
||||||
filter { "platforms:macosx*" }
|
filter { "platforms:bsd*" }
|
||||||
system "macosx"
|
system "bsd"
|
||||||
|
|
||||||
filter { "platforms:*x86*" }
|
filter { "platforms:macosx*" }
|
||||||
architecture "x86"
|
system "macosx"
|
||||||
|
|
||||||
filter { "platforms:*amd64*" }
|
filter { "platforms:*x86*" }
|
||||||
architecture "amd64"
|
architecture "x86"
|
||||||
|
|
||||||
filter { "platforms:*arm*" }
|
filter { "platforms:*amd64*" }
|
||||||
architecture "ARM"
|
architecture "amd64"
|
||||||
|
|
||||||
filter { "platforms:*arm64*" }
|
filter { "platforms:*arm*" }
|
||||||
architecture "ARM64"
|
architecture "ARM"
|
||||||
|
|
||||||
filter { "platforms:macosx-arm64*", "files:**.cpp"}
|
filter { "platforms:*arm64*" }
|
||||||
buildoptions { "-target", "arm64-apple-macos11", "-std=gnu++14" }
|
architecture "ARM64"
|
||||||
|
|
||||||
filter { "platforms:macosx-arm64*", "files:**.c"}
|
filter { "platforms:macosx-arm64*", "files:**.cpp"}
|
||||||
buildoptions { "-target", "arm64-apple-macos11" }
|
buildoptions { "-target", "arm64-apple-macos11", "-std=gnu++14" }
|
||||||
|
|
||||||
filter { "platforms:macosx-amd64*", "files:**.cpp"}
|
filter { "platforms:macosx-arm64*", "files:**.c"}
|
||||||
buildoptions { "-target", "x86_64-apple-macos10.12", "-std=gnu++14" }
|
buildoptions { "-target", "arm64-apple-macos11" }
|
||||||
|
|
||||||
filter { "platforms:macosx-amd64*", "files:**.c"}
|
filter { "platforms:macosx-amd64*", "files:**.cpp"}
|
||||||
buildoptions { "-target", "x86_64-apple-macos10.12" }
|
buildoptions { "-target", "x86_64-apple-macos10.12", "-std=gnu++14" }
|
||||||
|
|
||||||
filter {}
|
filter { "platforms:macosx-amd64*", "files:**.c"}
|
||||||
|
buildoptions { "-target", "x86_64-apple-macos10.12" }
|
||||||
|
|
||||||
|
filter {}
|
||||||
|
|
||||||
local function addSrcFiles( prefix )
|
local function addSrcFiles( prefix )
|
||||||
return prefix .. "/*cpp", prefix .. "/*.h", prefix .. "/*.c", prefix .. "/*.ico", prefix .. "/*.rc"
|
return prefix .. "/*cpp", prefix .. "/*.h", prefix .. "/*.c", prefix .. "/*.ico", prefix .. "/*.rc"
|
||||||
end
|
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/res") }
|
||||||
|
|
||||||
files { addSrcFiles("ISLE") }
|
includedirs { "LEGO1" }
|
||||||
files { addSrcFiles("ISLE/res") }
|
|
||||||
|
|
||||||
includedirs { "LEGO1" }
|
filter { "action:nmake2" }
|
||||||
|
--flag /ML or /MLd
|
||||||
|
staticruntime "libc"
|
||||||
|
|
||||||
filter { "platforms:win*" }
|
filter { "action:not nmake2" }
|
||||||
links { "dsound", "advapi32", "user32", "Gdi32", "Winmm" }
|
--flag /MT or /MTd
|
||||||
resoptions { "/l 0x409" }
|
staticruntime "on"
|
||||||
|
|
||||||
filter "configurations:Vanilla"
|
filter { "platforms:win*" }
|
||||||
defines { "VANILLA_DEFINES" }
|
links { "dsound", "advapi32", "user32", "gdi32", "winmm" }
|
||||||
|
--flag language for rc.exe
|
||||||
filter {}
|
resoptions { "/l 0x409" }
|
||||||
|
|
||||||
|
--this flags looks like default on,
|
||||||
|
--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 {}
|
||||||
project "lego1"
|
project "lego1"
|
||||||
--kind "StaticLib"
|
--TODO: create mxomni project and make static linking configuration
|
||||||
kind "SharedLib"
|
--kind "StaticLib"
|
||||||
targetname "lego1"
|
kind "SharedLib"
|
||||||
targetdir "bin/%{cfg.platform}/%{cfg.buildcfg}"
|
targetname "LEGO1"
|
||||||
staticruntime "on"
|
targetdir "bin/%{cfg.platform}/%{cfg.buildcfg}"
|
||||||
|
--flag /MT or /MTd
|
||||||
|
staticruntime "on"
|
||||||
|
|
||||||
files { addSrcFiles("LEGO1") }
|
files { addSrcFiles("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 {}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user