-
Notifications
You must be signed in to change notification settings - Fork 4
/
SConstruct
79 lines (56 loc) · 2.06 KB
/
SConstruct
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# master SConstruct for tibeecompare
#
# author: Francois Doray <francois.pierre-doray@polymtl.ca>
import os
# build mode (debug/release; default to release)
build_mode = ARGUMENTS.get('mode', 'release')
if build_mode not in ['debug', 'release']:
sys.stderr.write('Oh noes: only "debug" and "release" build modes are supported\n')
Exit(1)
# C++ flags and defines
ccflags = [
'-pthread',
'-std=c++11',
'-Wall',
'-pedantic-errors',
]
cppdefines = []
if build_mode == 'debug':
ccflags += ['-g', '-O0']
cppdefines += ['_DEBUG']
elif build_mode == 'release':
ccflags += ['-O2']
cppdefines += ['NDEBUG']
# this is to allow colorgcc
custom_env = {
'PATH': os.environ['PATH'],
'TERM': os.environ['TERM'],
'HOME': os.environ['HOME'],
}
root_env = Environment(CXXFLAGS=ccflags,
CPPDEFINES=cppdefines,
ENV=custom_env)
if 'CXX' in os.environ:
root_env['CXX'] = os.environ['CXX']
if 'TIGERBEETLE_CPPPATH' in os.environ:
root_env.Append(CPPPATH=[os.environ['TIGERBEETLE_CPPPATH']])
if 'TIGERBEETLE_LIBPATH' in os.environ:
root_env.Append(LIBPATH=[os.environ['TIGERBEETLE_LIBPATH']])
if 'LIBDELOREAN_CPPPATH' in os.environ:
root_env.Append(CPPPATH=[os.environ['LIBDELOREAN_CPPPATH']])
if 'LIBDELOREAN_LIBPATH' in os.environ:
root_env.Append(LIBPATH=[os.environ['LIBDELOREAN_LIBPATH']])
if 'BABELTRACE_CPPPATH' in os.environ:
root_env.Append(CPPPATH=[os.environ['BABELTRACE_CPPPATH']])
if 'BABELTRACE_LIBPATH' in os.environ:
root_env.Append(LIBPATH=[os.environ['BABELTRACE_LIBPATH']])
if 'BABELTRACE_CTF_LIBPATH' in os.environ:
root_env.Append(LIBPATH=[os.environ['BABELTRACE_CTF_LIBPATH']])
if 'LEVELDB_INCLUDEPATH' in os.environ:
root_env.Append(CPPPATH=[os.environ['LEVELDB_INCLUDEPATH']])
if 'LEVELDB_LIBPATH' in os.environ:
root_env.Append(LIBPATH=[os.environ['LEVELDB_LIBPATH']])
if 'LD_LIBRARY_PATH' in os.environ:
root_env['ENV']['LD_LIBRARY_PATH'] = os.environ['LD_LIBRARY_PATH']
Export('root_env')
apps = SConscript(os.path.join('src', 'SConscript'))