summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoromniscient <17525998+omnisci3nce@users.noreply.github.com>2024-03-09 16:46:29 +1100
committeromniscient <17525998+omnisci3nce@users.noreply.github.com>2024-03-09 16:46:29 +1100
commitf33792a01fa64126e1c481a77b49871dcd413fa1 (patch)
tree5ac65f4172e59b3a368c2813c1c95974f1768d94
parenta42c7d493a4b064b858dcd36623e13bc7099df9e (diff)
pull sources out into a local variable so we can share them easily
-rw-r--r--xmake.lua27
1 files changed, 16 insertions, 11 deletions
diff --git a/xmake.lua b/xmake.lua
index 18db07c..1b2683f 100644
--- a/xmake.lua
+++ b/xmake.lua
@@ -47,6 +47,19 @@ package_end()
add_requires("local_glfw")
+local core_sources = {
+ "deps/glad/src/glad.c",
+ "src/*.c",
+ "src/logos/*.c",
+ "src/platform/*.c",
+ "src/renderer/*.c",
+ "src/renderer/backends/*.c",
+ "src/resources/*.c",
+ "src/std/*.c",
+ "src/std/containers/*.c",
+ "src/systems/*.c",
+}
+
-- 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
@@ -67,27 +80,19 @@ target("core_config")
add_includedirs("src/std/", {public = true})
add_includedirs("src/std/containers", {public = true})
add_includedirs("src/systems/", {public = true})
- add_files("deps/glad/src/glad.c")
- add_files("src/*.c")
- add_files("src/logos/*.c")
- add_files("src/platform/*.c")
- add_files("src/renderer/*.c")
- add_files("src/renderer/backends/*.c")
- add_files("src/resources/*.c")
- add_files("src/std/*.c")
- add_files("src/std/containers/*.c")
- add_files("src/systems/*.c")
+ add_files("src/empty.c") -- for some reason we need this on Mac so it doesnt call 'ar' with no files and error
set_default(false) -- prevents standalone building of this target
target("core_static")
set_kind("static")
add_deps("core_config") -- inherit common configurations
set_policy("build.merge_archive", true)
- add_files("src/empty.c")
+ add_files(core_sources)
target("core_shared")
set_kind("shared")
add_deps("core_config") -- inherit common configurations
+ add_files(core_sources)
target("main_loop")
set_kind("binary")