-
Notifications
You must be signed in to change notification settings - Fork 38
/
AMBuilder
61 lines (52 loc) · 1.7 KB
/
AMBuilder
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
# vim: set sts=2 ts=8 sw=2 tw=99 et ft=python:
import os
libcurl = builder.Build('curl/lib/AMBuilder')
libjansson = builder.Build('jansson/src/AMBuilder')
libmbedtls = builder.Build('mbedtls/library/AMBuilder')
libnghttp2 = builder.Build('nghttp2/lib/AMBuilder')
libuv = builder.Build('libuv/src/AMBuilder')
libz = builder.Build('zlib/AMBuilder')
for cxx in builder.targets:
binary = Extension.Library(builder, cxx, 'rip.ext')
arch = binary.compiler.target.arch
binary.sources += [
'extension.cpp',
'httpclient.cpp',
'httprequest.cpp',
'httprequestcontext.cpp',
'httpfilecontext.cpp',
'httpformcontext.cpp',
'http_natives.cpp',
'json_natives.cpp',
os.path.join(Extension.sm_root, 'public', 'smsdk_ext.cpp'),
]
binary.compiler.includes += [
os.path.join(builder.sourcePath, 'curl', 'include'),
os.path.join(builder.sourcePath, 'jansson', 'include'),
os.path.join(builder.sourcePath, 'libuv', 'include'),
]
binary.compiler.defines += [
'CURL_STATICLIB',
]
if binary.compiler.family == 'gcc' or binary.compiler.family == 'clang':
binary.compiler.cxxflags += ['-fno-rtti']
elif binary.compiler.family == 'msvc':
binary.compiler.cxxflags += ['/GR-']
binary.compiler.postlink += [
libcurl[arch].binary,
libjansson[arch].binary,
libmbedtls[arch].binary,
libnghttp2[arch].binary,
libuv[arch].binary,
libz[arch].binary,
]
if binary.compiler.target.platform == 'linux':
binary.compiler.postlink += ['-lrt']
elif binary.compiler.target.platform == 'windows':
binary.compiler.postlink += [
'iphlpapi.lib',
'psapi.lib',
'userenv.lib',
'ws2_32.lib',
]
Extension.extensions += [builder.Add(binary)]