-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathxmake.lua
More file actions
40 lines (30 loc) · 894 Bytes
/
xmake.lua
File metadata and controls
40 lines (30 loc) · 894 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
32
33
34
35
36
37
38
39
40
add_rules("mode.debug", "mode.release")
add_rules("plugin.compile_commands.autoupdate", {outputdir = "build"}) -- generate compile commands
includes("rules/blang-yacc.lua")
add_rules("blang-yacc")
if is_plat("linux") then
set_policy("build.sanitizer.address", true)
set_policy("build.sanitizer.leak", true)
end
add_requires("fmt", {external=false})
add_requires("bison")
set_warnings("all") -- warns
set_languages("c++20", "c90")
target("blang")
set_kind("binary")
add_includedirs("src")
add_files("src/*.cc", "src/**/*.cc", "src/**/*.yy")
add_packages("fmt")
before_link(function(target)
import("core.base.process")
local stdout = os.tmpfile()
local stderr = os.tmpfile()
local proc = process.open("llvm-config --libs", {
stdout = stdout,
stderr = stderr
})
proc:wait()
proc:close()
target:add("ldflags", io.readfile(stdout):trim())
end)
target_end()