-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathxmake.lua
More file actions
31 lines (26 loc) · 817 Bytes
/
xmake.lua
File metadata and controls
31 lines (26 loc) · 817 Bytes
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
-- set_toolchains("clang")
-- set_toolset("cxx", "clang++") -- breaks on Nix without this line
set_languages "c++20"
set_defaultmode "debug"
set_policy("build.warning", true)
add_rules("mode.release", "mode.debug")
add_requires("ncurses" --[[, {system = false}]])
if is_mode "debug" then
local sanitize = { "-fsanitize=undefined", "-fsanitize=leak" }
local warnings = { "-Wall", "-Wextra", "-Weffc++", "-Wshadow" }
-- "-Wfatal-errors"
add_cxxflags(warnings, sanitize, "-pedantic-errors")
add_ldflags(sanitize, "-lubsan")
end
rule("ncurses")
on_load(function()
print("Hook is running!")
os.exec("echo 'Testing from xmake hook'")
os.exec("exit")
end)
target "program"
set_default(true)
set_kind "binary"
add_packages "ncurses"
add_files "src/**.cpp"
add_includedirs "inc"