summaryrefslogtreecommitdiff
path: root/xmake.lua
diff options
context:
space:
mode:
authoromnisci3nce <omniscient.oce@gmail.com>2024-04-28 09:14:22 +1000
committeromnisci3nce <omniscient.oce@gmail.com>2024-04-28 09:14:22 +1000
commit411520b240446f878a27c5d89812000774cc3c15 (patch)
tree989f442fdffcc85e45f665f8f22102fe6f6bae19 /xmake.lua
parentefea29ed9059303a5bb609ba0ce79c20ba894a23 (diff)
getting vulkan working on windows
Diffstat (limited to 'xmake.lua')
-rw-r--r--xmake.lua14
1 files changed, 11 insertions, 3 deletions
diff --git a/xmake.lua b/xmake.lua
index 0fc042c..6fee04a 100644
--- a/xmake.lua
+++ b/xmake.lua
@@ -1,6 +1,6 @@
set_project("celeritas")
set_version("0.1.0")
-set_config("cc", "clang")
+set_config("cc", "clang-cl")
add_rules("mode.debug", "mode.release") -- we have two modes: debug & release
@@ -25,6 +25,8 @@ if is_plat("linux") then
elseif is_plat("windows") then
add_defines("CEL_PLATFORM_WINDOWS")
add_syslinks("user32", "gdi32", "kernel32", "shell32")
+ add_requires("vulkansdk", {system=true})
+
-- add_links("pthreadVC2-w64")
elseif is_plat("macosx") then
add_defines("CEL_PLATFORM_MAC")
@@ -55,6 +57,7 @@ local core_sources = {
"deps/glad/src/glad.c",
"src/*.c",
-- "src/logos/*.c",
+ "src/maths/*.c",
"src/platform/*.c",
"src/renderer/*.c",
"src/renderer/backends/*.c",
@@ -84,6 +87,8 @@ rule("compile_glsl_frag_shaders")
end)
-- TODO: Metal shaders compilation
+--
+
-- 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
@@ -100,7 +105,6 @@ target("core_config")
add_includedirs("src/platform/", {public = true})
add_includedirs("src/renderer/", {public = true})
add_includedirs("src/renderer/backends/", {public = true})
- -- add_includedirs("src/renderer/cleanroom/", {public = true})
add_includedirs("src/resources/", {public = true})
add_includedirs("src/std/", {public = true})
add_includedirs("src/std/containers", {public = true})
@@ -111,6 +115,11 @@ target("core_config")
-- add_files("assets/shaders/object.vert")
-- add_files("assets/shaders/object.frag")
-- add_files("assets/shaders/*.frag")
+ if is_plat("windows") then
+ add_includedirs("$(env VULKAN_SDK)/Include", {public = true})
+ add_linkdirs("$(env VULKAN_SDK)/Lib", {public = true})
+ add_links("vulkan-1")
+ end
set_default(false) -- prevents standalone building of this target
target("core_static")
@@ -132,7 +141,6 @@ target("core_shared")
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")