-
Notifications
You must be signed in to change notification settings - Fork 0
/
AMBuilder
34 lines (28 loc) · 1.06 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
# vim: set sts=2 ts=8 sw=2 tw=99 et ft=python:
import os
for cxx in builder.targets:
binary = Extension.ExtLibrary(builder, cxx, 'timerex.ext')
arch = {'x86': 'i686', 'x86_64': 'x86_64'}[binary.compiler.target.arch]
if builder.options.opt == '1':
directory = 'release'
else:
directory = 'debug'
path = ''
if binary.compiler.target.platform == 'linux':
path = os.path.join(builder.currentSourcePath, 'target', f'{arch}-unknown-linux-gnu', directory, 'libtimerex.a')
elif binary.compiler.target.platform == 'windows':
path = os.path.join(builder.currentSourcePath, 'target', f'{arch}-pc-windows-msvc', directory, 'timerex.lib')
else:
raise
binary.compiler.postlink += [path]
binary.compiler.cxxincludes += [os.path.join(builder.currentSourcePath, 'timerex')]
if binary.compiler.family == 'msvc':
binary.compiler.linkflags += [
'userenv.lib',
'ws2_32.lib',
]
binary.sources += [
'timerex/extension.cpp',
os.path.join(Extension.sm_root, 'public', 'smsdk_ext.cpp'),
]
Extension.extensions = [builder.Add(binary)]