-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathxmake.lua
More file actions
133 lines (111 loc) · 4.44 KB
/
Copy pathxmake.lua
File metadata and controls
133 lines (111 loc) · 4.44 KB
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
---@diagnostic disable: undefined-global
includes("tools/xmake/*.lua")
add_rules("mode.debug", "mode.release")
if is_plat("windows") then
add_requires("msvc")
set_toolchains("@msvc")
end
set_languages("c++20")
local CORE_ONLY_FLAG = "CoreOnly"
option(CORE_ONLY_FLAG, {default = false, description = "Build the engine core and the utils only, without the plugins"})
add_requires("entt v3.15.0",
"gtest v1.17.0",
"spdlog v1.16.0")
add_requires("fmt 12.1.0", { configs = { header_only = true }, debug = is_mode("debug") })
includes("src/engine/xmake.lua")
includes("src/utils/*/xmake.lua")
if not has_config(CORE_ONLY_FLAG) then
add_requires(
"tinyobjloader v2.0.0rc13",
"glm 1.0.1",
"glfw 3.4",
"freetype 2.14.1",
"zlib 1.3.1",
"stb 2025.03.14",
"miniaudio 0.11.23",
"lodepng 2025.05.06",
"wgpu-native ^24.0.0",
"glfw3webgpu v1.3.0-alpha",
{ debug = is_mode("debug") }
)
add_requires("joltphysics v5.4.0", { configs = { symbols = is_mode("debug") }, debug = is_mode("debug") })
add_requires("rmlui 6.2", { configs = { transform = true, font_effects = true }, debug = is_mode("debug") })
includes("src/plugin/*/xmake.lua")
end
add_rules("plugin.vsxmake.autoupdate")
add_rules("plugin.compile_commands.autoupdate", {outputdir = ".vscode"})
target("EngineSquared")
set_kind("object")
set_version("0.0.0")
add_deps("EngineSquaredCore")
if not has_config(CORE_ONLY_FLAG) then
add_deps("PluginInput")
add_deps("PluginObject")
add_deps("PluginScene")
add_deps("PluginSound")
add_deps("PluginWindow")
add_deps("PluginRelationship")
add_deps("PluginNativeScripting")
add_deps("PluginRenderingPipeline")
add_deps("PluginGraphic")
add_deps("PluginPhysics")
add_deps("PluginCameraMovement")
add_deps("PluginEvent")
add_deps("PluginDefaultPipeline")
add_deps("PluginRmlui")
add_packages("glfw", "glm", "tinyobjloader", "stb", "joltphysics", "wgpu-native",
"rmlui", "freetype", "zlib")
if is_plat("windows") then
add_links("freetype", "zlib")
else
add_links("freetype", "z")
end
end
add_deps("UtilsTools")
add_deps("UtilsLog")
add_packages("entt", "spdlog", "fmt")
if is_mode("debug") then
add_defines("DEBUG")
add_defines("ES_DEBUG")
if is_plat("windows") then
add_cxflags("/Od", "/Zi", "/Wall", "/MTd")
else
add_cxflags("-O0 -g3 -ggdb")
end
else
add_defines("NDEBUG")
add_cxflags("-O2")
end
target_end()
local ALL_EXAMPLES_FLAG = "AllExamples"
local ALL_PRIMARY_EXAMPLES_FLAG = "AllPrimaryExamples"
local EXECUTABLE_EXAMPLES_FLAG = "ExecutableExamples"
option(ALL_EXAMPLES_FLAG, {default = false, description = "Enable all examples"})
option(ALL_PRIMARY_EXAMPLES_FLAG, {default = false, description = "Enable all primary examples"})
option(EXECUTABLE_EXAMPLES_FLAG, {default = false, description = "Enable executable examples"})
local all_examples_folder = {}
if has_config(CORE_ONLY_FLAG) then
table.join2(all_examples_folder, os.dirs(path.join("src", "engine", "examples", "*")))
else
table.join2(all_examples_folder, os.dirs(path.join("src", "**", "examples", "*")))
table.join2(all_examples_folder, os.dirs(path.join(".", "examples", "*")))
end
for _, dir in ipairs(all_examples_folder) do
local name = path.basename(dir)
option(name, {default = false, description = "Enable \"" .. name .. "\" Example"})
if has_config(ALL_EXAMPLES_FLAG) or has_config(name) or has_config(EXECUTABLE_EXAMPLES_FLAG) or has_config(ALL_PRIMARY_EXAMPLES_FLAG) then
if (not os.isfile(path.join(dir, "xmake.lua"))) then
print("Warning: No xmake.lua found in " .. dir .. ", skipping...")
else
if has_config(name) then
includes(path.join(dir, "xmake.lua"))
elseif has_config(EXECUTABLE_EXAMPLES_FLAG) and os.isfile(path.join(dir, ".ci_run_target")) then
includes(path.join(dir, "xmake.lua"))
elseif has_config(ALL_PRIMARY_EXAMPLES_FLAG) and not os.isfile(path.join(dir, ".secondary")) then
includes(path.join(dir, "xmake.lua"))
elseif has_config(ALL_EXAMPLES_FLAG) then
includes(path.join(dir, "xmake.lua"))
end
end
end
end