-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAMBuilder
49 lines (41 loc) · 1.71 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
# vim: set sts=2 ts=8 sw=2 tw=99 et ft=python:
import os
libjansson = builder.Build('jansson/src/AMBuilder')
for cxx in builder.targets:
binary = Extension.Library(builder, cxx, 'jansson.ext')
arch = binary.compiler.target.arch
binary.sources += [
'extension.cpp',
os.path.join(builder.sourcePath, 'src', 'json.cpp'),
os.path.join(builder.sourcePath, 'src', 'json_utils.cpp'),
os.path.join(builder.sourcePath, 'src', 'jansson.cpp'),
os.path.join(builder.sourcePath, 'src/types', 'CHandleType.cpp'),
os.path.join(builder.sourcePath, 'src/types', 'CHandleTypeManager.cpp'),
os.path.join(builder.sourcePath, 'src/natives', 'json_natives.cpp'),
os.path.join(builder.sourcePath, 'src/natives', 'json_o_natives.cpp'),
os.path.join(builder.sourcePath, 'src/natives', 'json_a_natives.cpp'),
os.path.join(builder.sourcePath, 'src/utils', 'handles.cpp'),
os.path.join(builder.sourcePath, 'src/utils', 'types.cpp'),
os.path.join(Extension.sm_root, 'public', 'smsdk_ext.cpp'),
]
binary.compiler.includes += [
os.path.join(builder.sourcePath),
os.path.join(builder.sourcePath, 'jansson', 'include'),
]
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 += [
libjansson[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)]