This repository has been archived by the owner on Jul 15, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
xmake.lua
60 lines (50 loc) · 1.67 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
60
-- xmake f -p solaris
-- xmake f -p zos
-- xmake f -p freebsd
-- xmake f -p dragonflybsd
-- xmake f -p openbsd
-- xmake f -p netbsd
-- xmake f -p unix
--
add_defines("CROSSPLATFORM_OS_STRING=\"$(plat)\"")
add_defines("CROSSPLATFORM_OS_IS_$(plat:upper)")
--OS Arch Declaration
if is_arch("i386") or is_arch("x86") then
add_defines("EASYCROSSPLATFORM_ARCHITECTURE_X86")
elseif is_arch("x86_64") or is_arch("x64") then
add_defines("EASYCROSSPLATFORM_ARCHITECTURE_X64")
elseif is_arch("arm64*") then
add_defines("EASYCROSSPLATFORM_ARCHITECTURE_ARM64")
elseif is_arch("armv5*") then
add_defines("EASYCROSSPLATFORM_ARCHITECTURE_ARMv5")
elseif is_arch("armv6*") then
add_defines("EASYCROSSPLATFORM_ARCHITECTURE_ARMv6")
elseif is_arch("armv7*") then
add_defines("EASYCROSSPLATFORM_ARCHITECTURE_ARMv7")
elseif is_arch("armv8*") then
add_defines("EASYCROSSPLATFORM_ARCHITECTURE_ARMv8")
end
--std declaration
if not is_os("windows") then
set_languages("cxx11")
end
-- add link and include directories
add_includedirs("include")
add_linkdirs("extlibs")
-- includes
includes("deps/cryptopp","deps/libuv","deps/jsoncpp","deps/mbedtls","deps/wai","deps/brotli","deps/iconv","deps/websocketpp","deps/nghttp2")
-- define target
target("easycrossplatform")
-- set kind
set_kind("$(kind)")
if is_kind("static") then
add_defines("USING_STATIC_LIBICONV","NGHTTP2_STATICLIB")
add_links("mariadbclient")
else --is_kind("shared")
add_defines("UV_SHARED")
add_links("mariadb")
end
-- add files
add_files("src/**.cpp")
-- add deps
add_deps("cryptopp", "libuv", "jsoncpp", "mbedtls", "whereami", "brotli", "iconv", "websocketpp","nghttp2")