-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathxmake.lua
More file actions
68 lines (54 loc) · 2.16 KB
/
xmake.lua
File metadata and controls
68 lines (54 loc) · 2.16 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
---@diagnostic disable: undefined-global
UTILS_GROUP_NAME = "Utils"
add_rules("mode.debug", "mode.release")
add_requires(
"gtest v1.17.0",
"spdlog v1.16.0",
{ debug = is_mode("debug") }
)
add_requires("fmt 12.1.0", { configs = { header_only = true }, debug = is_mode("debug") })
set_languages("c++20")
includes("src/function-container/xmake.lua")
includes("src/log/xmake.lua")
includes("src/tools/xmake.lua")
add_rules("plugin.vsxmake.autoupdate")
add_rules("plugin.compile_commands.autoupdate", {outputdir = ".vscode"})
target("EngineSquaredTools")
set_kind("object")
set_version("1.0.0")
add_deps("UtilsFunctionContainer")
add_deps("UtilsTools")
add_deps("UtilsLog")
add_packages("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_NAME = "all_examples"
local EXECUTABLE_EXAMPLES_FLAG_NAME = "executable_examples"
option(ALL_EXAMPLES_FLAG_NAME, {default = false, description = "Enable all examples"})
option(EXECUTABLE_EXAMPLES_FLAG_NAME, {default = false, description = "Enable executable examples"})
for _, dir in ipairs(os.dirs("examples/*")) do
local name = path.basename(dir)
option(name, {default = false, description = "Enable \"" .. name .. "\" Example"})
if has_config(ALL_EXAMPLES_FLAG_NAME) or has_config(name) or has_config(EXECUTABLE_EXAMPLES_FLAG_NAME) then
if (not os.isfile(path.join(dir, "xmake.lua"))) then
print("Warning: No xmake.lua found in " .. dir .. ", skipping...")
else
if has_config(EXECUTABLE_EXAMPLES_FLAG_NAME) and os.isfile(path.join("examples", name, ".ci_run_target")) then
includes(path.join("examples", name, "xmake.lua"))
elseif has_config(ALL_EXAMPLES_FLAG_NAME) or not has_config(EXECUTABLE_EXAMPLES_FLAG_NAME) then
includes(path.join("examples", name, "xmake.lua"))
end
end
end
end