-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
make.py
53 lines (39 loc) · 1.24 KB
/
make.py
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
project('stack_trace')
# Variables
flags = cfgvar('stack_trace.flags', 'flags', description='list of abstract build flags (see doozer docs)')
platform = cfgvar('stack_trace.platform', description='"windows" or "osx"')
# Builds a static library for stack_trace.
@target
def staticlib(kit):
opt = kit.cpp.opt(*flags)
opt.sources += here/'src/*.cpp'
opt.includes += [here/'include']
syslibs = []
if platform == 'windows':
if 'msvc' in kit.installed():
opt.cppflags -= ['/Za']
syslibs = ['imagehlp']
if 'gpp' in kit.installed():
syslibs += ['bfd', 'iberty']
if kit.cpp.compiler.version >= (4,5):
syslibs += ['intl', 'iconv']
return properties(
libs = [kit.cpp.lib('stack_trace', opt)],
includes = [here/'include'],
syslibs = syslibs
)
@target
def basic_example(kit):
stack_trace = staticlib(kit)
opt = kit.cpp.opt(*flags)
opt.sources += here/'example/*.cpp'
opt.includes += stack_trace.includes
opt.libs += stack_trace.libs
opt.syslibs += stack_trace.syslibs
return process(kit.cpp.exe('example', opt))
@target
def examples(kit):
return [basic_example(kit)]
@target
def default(kit):
examples(kit)