-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathxmake.lua
More file actions
134 lines (115 loc) · 4.52 KB
/
xmake.lua
File metadata and controls
134 lines (115 loc) · 4.52 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
134
---@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
add_requires(
"entt v3.15.0",
"gtest v1.17.0",
"spdlog v1.16.0",
"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("fmt 12.1.0", { configs = { header_only = true }, debug = is_mode("debug") })
add_requires("rmlui 6.2", { configs = { transform = true, font_effects = true }, debug = is_mode("debug") })
set_languages("c++20")
includes("src/engine/xmake.lua")
includes("src/plugin/input/xmake.lua")
includes("src/plugin/native-scripting/xmake.lua")
includes("src/plugin/object/xmake.lua")
includes("src/plugin/relationship/xmake.lua")
includes("src/plugin/scene/xmake.lua")
includes("src/plugin/sound/xmake.lua")
includes("src/plugin/window/xmake.lua")
includes("src/plugin/rendering-pipeline/xmake.lua")
includes("src/plugin/graphic/xmake.lua")
includes("src/plugin/physics/xmake.lua")
includes("src/utils/function-container/xmake.lua")
includes("src/utils/log/xmake.lua")
includes("src/utils/tools/xmake.lua")
includes("src/plugin/event/xmake.lua")
includes("src/plugin/camera-movement/xmake.lua")
includes("src/plugin/default-pipeline/xmake.lua")
includes("src/plugin/rmlui/xmake.lua")
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")
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("UtilsTools")
add_deps("PluginPhysics")
add_deps("PluginCameraMovement")
add_deps("UtilsLog")
add_deps("PluginEvent")
add_deps("PluginDefaultPipeline")
add_deps("PluginRmlui")
add_packages("entt", "glfw", "glm", "spdlog", "tinyobjloader", "fmt", "stb", "joltphysics", "wgpu-native",
"rmlui", "freetype", "zlib")
if is_plat("windows") then
add_links("freetype", "zlib")
else
add_links("freetype", "z")
end
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 = {}
table.join2(all_examples_folder, os.dirs(path.join("src", "**", "examples", "*")))
table.join2(all_examples_folder, os.dirs(path.join(".", "examples", "*")))
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