-
Notifications
You must be signed in to change notification settings - Fork 45
Expand file tree
/
Copy pathxmake.lua
More file actions
74 lines (66 loc) · 2.59 KB
/
xmake.lua
File metadata and controls
74 lines (66 loc) · 2.59 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
add_rules("mode.debug", "mode.release")
set_languages("c++23")
-- GCC 15 ICE workaround: -O1/-O2 crash in tree-ssa-dce with C++23 modules
if is_plat("linux") then
add_cxxflags("-Og", {force = true})
end
add_repositories("mcpplibs-index https://github.com/mcpplibs/mcpplibs-index.git")
add_requires("cmdline 0.0.2")
add_requires("ftxui 6.1.9")
add_requires("mcpplibs-capi-lua")
add_requires("mcpplibs-xpkg 0.0.31")
add_requires("gtest 1.15.2")
add_requires("mcpplibs-tinyhttps 0.2.0")
-- libarchive's compression backends. Force `system = false` so xmake
-- builds them from source under our musl-cross toolchain instead of
-- picking up the host's glibc-built /usr/lib copies, which can't be
-- linked into a musl-static binary. Required for the linux release
-- build; harmless on macOS/Windows.
add_requires("zlib", { system = false })
add_requires("lz4", { system = false })
add_requires("bzip2", { system = false })
add_requires("zstd", { system = false })
add_requires("lzma", { system = false })
add_requires("libarchive 3.8.7")
-- C++23 main binary
target("xlings")
set_kind("binary")
add_files("src/main.cpp")
add_files("src/**.cppm")
add_includedirs("src/libs/json")
add_packages("cmdline", "ftxui", "mcpplibs-capi-lua")
add_packages("mcpplibs-xpkg")
add_packages("mcpplibs-tinyhttps", "libarchive")
set_policy("build.c++.modules", true)
if is_plat("macosx") then
set_toolchains("llvm")
elseif is_plat("linux") then
add_ldflags("-static", {force = true})
elseif is_plat("windows") then
-- libarchive's XAR format parser uses xmllite (CreateXmlReader);
-- xmake-repo's libarchive package_def only adds advapi32. Add
-- xmllite here so the link step finds CreateXmlReader.
add_syslinks("xmllite")
end
-- Unit tests
target("xlings_tests")
set_kind("binary")
set_default(false)
set_rundir("$(projectdir)")
add_files("tests/unit/*.cpp")
add_files("src/**.cppm")
add_includedirs("src/libs/json")
add_packages("cmdline", "ftxui", "mcpplibs-capi-lua", "gtest")
add_packages("mcpplibs-xpkg")
add_packages("mcpplibs-tinyhttps", "libarchive")
set_policy("build.c++.modules", true)
if is_plat("macosx") then
set_toolchains("llvm")
elseif is_plat("linux") then
add_ldflags("-static", {force = true})
elseif is_plat("windows") then
-- libarchive's XAR format parser uses xmllite (CreateXmlReader);
-- xmake-repo's libarchive package_def only adds advapi32. Add
-- xmllite here so the link step finds CreateXmlReader.
add_syslinks("xmllite")
end