Repository navigation
Expand file tree
/
Copy pathxmake.lua
More file actions
74 lines (59 loc) · 2.61 KB
/
Copy pathxmake.lua
File metadata and controls
74 lines (59 loc) · 2.61 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
set_project("ilias")
set_version("0.5.1", {soname = true})
set_xmakever("3.0.0")
-- Cpp version
option("stdcxx", {showmenu = true, default = 23, values = {26, 23, 20}})
function stdcxx() return "c++" .. tostring(get_config("stdcxx")) end
set_languages(stdcxx())
set_encodings("utf-8")
add_rules("mode.release", "mode.debug", "mode.releasedbg", "mode.coverage")
add_rules("plugin.compile_commands.autoupdate", {lsp = "clangd", outputdir = "./build"})
set_policy("package.include_external_headers", false)
-- Options
option("fmt", {default = false, description = "Use fmt replace std::format"})
option("log", {default = false, description = "Enable logging"})
option("openssl", {default = false, description = "Always use openssl instead of native tls"})
option("spdlog", {default = false, description = "Use spdlog for logging"})
option("io_uring", {default = false, description = "Use io uring as platform context"})
option("coro_trace", {default = false, description = "Add coroutine trace for debug use"})
option("tls", {default = true, description = "Enable tls support"})
option("fiber", {default = true, description = "Enable stackful coroutine 'fiber' support"})
option("modules", {default = false, description = "Enable c++ modules support"})
option("noexcept", {default = false, description = "Disable c++ exception"})
-- No-op Options (leave for compatibility currently)
option("io", {default = true, description = "Enable io support"})
-- Qt
option("qt_interop", {default = false, description = "Enable qt test and example"})
-- Debug Option
option("dev", {default = false, description = "Enable dev mode, we are debugging"})
option("sanitizer", {default = false, description = "Enable asan and ubsan"})
-- Checking std
includes("scripts/lua/check")
check_macros("has_std_expected", "__cpp_lib_expected", {languages = stdcxx(), includes = "version"})
-- Add packages if
if has_config("fmt") then
add_requires("fmt")
end
if has_config("io_uring") then
add_requires("liburing")
end
if has_config("tls") then
-- Not in windows or force use openssl
if not is_plat("windows", "mingw") or has_config("openssl") then
add_requires("openssl3")
end
end
if has_config("spdlog") and has_config("log") then
add_requires("spdlog")
end
if has_config("sanitizer") then
set_policy("build.sanitizer.address", true)
set_policy("build.sanitizer.undefined", true)
end
-- Another target
includes("./src")
includes("./example")
includes("./benchmark")
if has_config("dev") then
includes("./tests")
end