-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSConstruct
59 lines (46 loc) · 1.3 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
# -*- mode: python -*-
import os
AddOption(
'--dbg',
action='store_true',
help='debug build',
default=False)
env = Environment(CPPPATH=['#/src', '#/lib/mongoose', '#/lib/jsoncpp/dist/', '#/gen-cpp'],
CXXFLAGS=["--std=c++11", "-Wall", "-Werror"])
Export('env')
if GetOption('dbg'):
env.Append(CXXFLAGS=['-g'])
opt_flag = '-O0'
variant_dir = 'build/debug'
else:
opt_flag = '-O3'
variant_dir = 'build/release'
env.Append(CXXFLAGS=[opt_flag])
env.Command(
'#/gen-cpp/Replication.cpp',
'#/src/net/repl.thrift',
'thrift --gen cpp $SOURCE')
env.Command(
'#/gen-cpp/Partition.cpp',
'#/src/net/partition.thrift',
'thrift --gen cpp $SOURCE')
env.Command('#/lib/mongoose/libmongoose.a', [
Glob('#/lib/mongoose/mongoose/*'),
Glob('#/lib/mongoose/mongoose.*'),
],
'cmake -JSONCPP_DIR=../jsoncpp -DHAS_JSONCPP=ON . && make',
chdir=True)
env.Command('#/lib/jsoncpp/dist/json/json.h', [
Glob('#/lib/jsoncpp/include/*'),
Glob('#/lib/jsoncpp/src/*'),
],
'python amalgamate.py',
chdir='lib/jsoncpp')
env.Command('#/lib/jsoncpp/src/lib_json/libjsoncpp.a', [
Glob('#/lib/jsoncpp/include/*'),
],
'cmake . && make',
chdir='lib/jsoncpp')
env.SConscript(dirs=[
'src'
], variant_dir=variant_dir)