-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathxmake.lua
More file actions
executable file
·101 lines (75 loc) · 2.12 KB
/
xmake.lua
File metadata and controls
executable file
·101 lines (75 loc) · 2.12 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
-- project
set_project("pre-dem-curl")
-- version
set_version("0.0.1")
cpputest_home = "/usr/local/"
-- set warning all as error
set_warnings("all", "error")
-- set language: c99
set_languages("c99")
-- the debug or check or coverage mode
if is_mode("debug", "check", "coverage") then
-- enable the debug symbols
set_symbols("debug")
-- disable optimization
set_optimize("none")
-- add defines for debug
add_defines("__tb_debug__")
-- attempt to enable some checkers for pc
if is_mode("check") and is_arch("i386", "x86_64") then
add_cxflags("-fsanitize=address", "-ftrapv")
add_mxflags("-fsanitize=address", "-ftrapv")
add_ldflags("-fsanitize=address")
end
-- enable coverage
if is_mode("coverage") then
add_cxflags("--coverage")
add_cxflags("-ftest-coverage")
add_mxflags("--coverage")
add_ldflags("--coverage")
end
end
-- the release mode
if is_mode("release") then
-- set the symbols visibility: hidden
set_symbols("hidden")
-- enable fastest optimization
set_optimize("fastest")
-- strip all symbols
set_strip("all")
end
-- add option: CppUTest
option("CppUTest")
set_default(false)
set_showmenu(true)
set_category("option")
set_description("Specify CppUTest Home")
-- add target
target("run_all_tests")
-- set kind
set_kind("binary")
-- add define for getaddrinfo
if is_os("linux") then
add_defines("_POSIX_C_SOURCE=200112L")
end
-- add include directories
add_includedirs("include", "mocks", cpputest_home .. "include")
-- add files
add_files("source/**.c", "test/**.cpp")
-- add link library
add_links("CppUTest")
add_links("curl")
-- add link directories
add_linkdirs(cpputest_home .. "lib")
-- add target
target("pre-dem-curl")
-- set kind
set_kind("static")
-- add define for getaddrinfo
if is_os("linux") then
add_defines("_POSIX_C_SOURCE=200112L")
end
-- add include directories
add_includedirs("include", "mocks", cpputest_home .. "include")
-- add files
add_files("source/**.c")