summaryrefslogtreecommitdiff
path: root/xmake.lua
diff options
context:
space:
mode:
authoromnisci3nce <omniscient.oce@gmail.com>2024-04-27 13:32:57 +1000
committeromnisci3nce <omniscient.oce@gmail.com>2024-04-27 13:32:57 +1000
commitf5c7f55fcfb4df4b9aa67b11a847340f0d8c95c4 (patch)
tree208026b4084495909e7ec74bef2911bd963e6c8b /xmake.lua
parent4cbc38b92edaa331fd0f6a077bbe7d7aebdb9ecf (diff)
parentc7bede459cc7d5141f9b0fc5a54868484925b27b (diff)
Merge remote-tracking branch 'origin/cel-36-test-windows-build' into realign
Diffstat (limited to 'xmake.lua')
-rw-r--r--xmake.lua16
1 files changed, 13 insertions, 3 deletions
diff --git a/xmake.lua b/xmake.lua
index 63b3d9c..a5e6239 100644
--- a/xmake.lua
+++ b/xmake.lua
@@ -4,8 +4,6 @@ set_config("cc", "gcc")
add_rules("mode.debug", "mode.release") -- we have two modes: debug & release
-add_syslinks("m") -- these are must have when compiling
-
-- -Wall : base set of warnings
-- -Wextra : additional warnings not covered by -Wall
-- -Wundef : undefined macros
@@ -26,6 +24,8 @@ if is_plat("linux") then
add_syslinks("vulkan", "dl", "X11", "pthread")
elseif is_plat("windows") then
add_defines("CEL_PLATFORM_WINDOWS")
+ add_syslinks("user32", "gdi32", "kernel32", "shell32")
+ add_links("pthreadVC2-w64")
elseif is_plat("macosx") then
add_defines("CEL_PLATFORM_MAC")
add_frameworks("Cocoa", "IOKit", "CoreVideo", "OpenGL")
@@ -88,7 +88,6 @@ end)
-- common configuration for both static and shared libraries
target("core_config")
set_kind("static") -- kind is required but you can ignore it since it's just for common settings
- add_syslinks("dl")
add_packages("local_glfw")
add_includedirs("deps/cgltf", {public = true})
add_includedirs("deps/glfw-3.3.8/include/GLFW", {public = true})
@@ -120,11 +119,22 @@ target("core_static")
add_deps("core_config") -- inherit common configurations
set_policy("build.merge_archive", true)
add_files(core_sources)
+ -- Link against static CRT
+ if is_plat("windows") then
+ add_links("libcmt", "legacy_stdio_definitions") -- for release builds
+ add_links("libcmtd", "legacy_stdio_definitions") -- for debug builds
+ end
target("core_shared")
set_kind("shared")
add_deps("core_config") -- inherit common configurations
add_files(core_sources)
+ -- Link against dynamic CRT
+ if is_plat("windows") then
+ add_links("msvcrt", "legacy_stdio_definitions") -- for release builds
+ add_links("msvcrtd", "legacy_stdio_definitions") -- for debug builds
+ add_links("pthreadVC2-w64")
+ end
target("main_loop")
set_kind("binary")