-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathxmake.lua
43 lines (38 loc) · 1.25 KB
/
xmake.lua
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
add_rules("mode.debug", "mode.release", "mode.valgrind")
package("libdill")
add_deps("make")
add_urls("https://github.com/sustrik/libdill.git")
on_install("linux", "macosx", function(package)
os.vrun("./autogen.sh")
os.vrun("./configure %s %s --prefix=\"%s\"", "--disable-shared --disable-sockets", is_mode("debug") and "--enable-valgrind" or "", package:installdir())
os.vrun("make")
os.vrun("make check")
os.vrun("make install")
end)
package_end()
target("test")
set_kind("binary")
add_files("test/flashlight.c")
add_packages("libdill", "pthread", "pcre2")
add_cflags("-Wall -Werror")
after_build(function (target)
os.exec("./%s", target:targetfile())
end)
target_end()
target("leaks")
set_kind("binary")
add_cflags("-g", "-O2", "-DDEBUG")
add_files("test/bin.c")
add_packages("libdill", "pthread", "pcre2", "valgrind")
after_build(function (target)
os.exec("valgrind --show-leak-kinds=all --track-origins=yes --leak-check=full %s", target:targetfile())
end)
target_end()
add_requires("pthread", "pcre2", "libdill")
target("flashlight")
set_kind("$(kind)")
add_ldflags("-ldill")
add_files("src/flashlight.c")
add_headerfiles("src/flashlight.h")
add_packages("pthread", "pcre2", "libdill")
target_end()