forked from idealvin/coost
-
Notifications
You must be signed in to change notification settings - Fork 0
/
xmake.lua
59 lines (47 loc) · 1.4 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
-- plat
set_config("plat", os.host())
-- project
set_project("co")
-- set xmake minimum version
set_xmakever("2.2.5")
-- set common flags
set_languages("c++11")
set_optimize("faster") -- faster: -O2 fastest: -O3 none: -O0
set_warnings("all") -- -Wall
set_symbols("debug") -- dbg symbols
if is_plat("macosx", "linux") then
add_cxflags("-g3", "-Wno-narrowing", "-Wno-sign-compare", "-Wno-class-memaccess")
if is_plat("macosx") then
add_cxflags("-fno-pie")
end
add_syslinks("pthread", "dl")
end
if is_plat("windows") then
add_defines("_ITERATOR_DEBUG_LEVEL=0")
add_cxflags("-MD", "-EHsc")
end
---[[
--add_requires("zlib", {optional = true})
add_requires("openssl >=1.1.0", {optional = true})
add_requires("libcurl", {optional = true, configs = {openssl = true, zlib = true}})
if has_package("libcurl") then
add_defines("HAS_LIBCURL")
add_packages("libcurl")
end
--if has_package("zlib") then
-- add_defines("HAS_ZLIB")
-- add_packages("zlib")
--end
if has_package("openssl") then
add_defines("CO_SSL")
add_defines("HAS_OPENSSL")
add_packages("openssl")
end
--]]
-- include dir
add_includedirs("include")
-- install header files
add_installfiles("(include/**)", {prefixdir = ""})
add_installfiles("*.md", {prefixdir = "include/co"})
-- include sub-projects
includes("src", "gen", "test", "unitest")