-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathxmake.lua
77 lines (67 loc) · 1.87 KB
/
xmake.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
set_project("void_engine")
set_version("0.1.0")
set_languages("cxx23")
set_warnings("allextra", "pedantic", "error")
add_rules("mode.debug", "mode.release", "mode.releasedbg", "mode.check", "mode.profile")
add_rules("plugin.compile_commands.autoupdate", { lsp = "clangd", outputdir = "build" })
if is_mode("debug") then
add_defines("DEBUG")
end
add_defines("GLM_ENABLE_EXPERIMENTAL")
add_requireconfs("*", { system = false })
add_requires("glfw", { version = "^3.4" })
add_requires("glad", { version = "^0.1.36", configs = { profile = "core" } })
add_requires("glm", { version = "^1.0.1" })
add_requires("stb", { version = "^2024.06.01" })
add_requires("freetype", { version = "^2.13.1" })
add_requires("harfbuzz", { version = "^9.0.0" })
target("void_engine", function()
set_kind("static")
add_rules(
"utils.glsl2spv",
{ outputdir = "build/shaders", targetenv = "opengl", client = "opengl100", bin2c = true }
)
add_rules("utils.bin2c", { extensions = { ".ttf" } })
add_files({
"src/**.cpp",
"resources/shaders/**.vert",
"resources/shaders/**.frag",
"resources/fonts/**.ttf",
})
add_includedirs("include")
add_packages({ "glfw", "glad", "glm", "stb", "freetype", "harfbuzz" })
end)
option("tests", {
description = "Build test suite",
showmenu = true,
default = false,
type = "boolean",
})
option("examples", {
description = "Build examples",
showmenu = true,
default = false,
type = "boolean",
})
if has_config("examples") then
for _, example in ipairs(os.files("examples/*.cpp")) do
local name = path.basename(example)
target(name, {
kind = "binary",
files = example,
includedirs = "include",
deps = "void_engine",
packages = { "glm" },
})
end
end
if has_config("tests") then
add_requires("catch2 ^3.6.0")
target("tests", {
kind = "binary",
files = "tests/**.cpp",
includedirs = "include",
deps = "void_engine",
packages = "catch2",
})
end