-
-
Notifications
You must be signed in to change notification settings - Fork 369
Expand file tree
/
Copy pathxmake.lua
More file actions
61 lines (49 loc) · 1.47 KB
/
Copy pathxmake.lua
File metadata and controls
61 lines (49 loc) · 1.47 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
set_warnings("all", "error")
-- set language: c99
stdc = "c99"
set_languages(stdc)
-- disable some compiler errors
add_cxflags("-Wno-error=deprecated-declarations", "-fno-strict-aliasing", "-Wno-error=expansion-to-defined")
-- add build modes
add_rules("mode.release", "mode.debug")
add_defines("_UNICODE", "YUTIL_EXPORTS")
if is_plat("windows") then
add_defines("_CRT_SECURE_NO_WARNINGS")
else
add_defines("_GNU_SOURCE=1")
end
if is_mode("release") then
set_symbols("none")
end
-- 'xmake f --optionname=test'
option("yutil_test")
set_default(true)
set_showmenu(true)
set_category("test")
set_description("Enable or disable yutil_test option")
option_end()
-- include project sources
includes("tests")
target("yutil")
-- make as a static/shared library
set_kind("$(kind)")
if is_kind("shared") then
-- export all symbols for windows/dll
if is_plat("windows") then
if is_mode("release") then
set_optimize("fastest")
end
add_rules("utils.symbols.export_all")
end
else
set_configvar("YUTIL_STATIC_BUILD", 1)
end
-- add include directories
add_includedirs("include", {public = true})
-- add the header files for installing
add_headerfiles("include/yutil.h")
add_headerfiles("include/(yutil/*.h)")
set_configdir("include/yutil")
add_configfiles("include/yutil/config.h.in")
-- add the common source files
add_files("src/*.c")