forked from mongodb/mongo-perf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSConstruct
54 lines (41 loc) · 1.31 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
# -*- mode: python; -*-
import os
env = Environment()
cpp_flags = ['-g']
link_flags = ['-g']
if not 'darwin' == os.sys.platform:
cpp_flags.extend(['-O2', '-pthread'])
link_flags.append('-pthread')
env.Append(CPPFLAGS=cpp_flags)
env.Append(LINKFLAGS=link_flags)
if 'darwin' == os.sys.platform:
if os.path.exists('/opt/local/include'):
env.Append(CPPPATH=['/opt/local/include'])
if os.path.exists('/opt/local/lib'):
env.Append(LIBPATH=['/opt/local/lib'])
env.Append(CPPPATH=['mongo-cxx-driver/src'])
env.Append(CPPPATH=['mongo-cxx-driver/src/mongo'])
env.Append(LIBPATH=['mongo-cxx-driver'])
conf = Configure( env )
libs = ["mongoclient",
"boost_graph",
"boost_thread",
"boost_filesystem",
'boost_program_options',
'boost_system']
def checkLib( lib ):
if lib.startswith('boost_'):
if conf.CheckLib( lib + '-mt' ):
return True
if conf.CheckLib( lib ):
return True
print( "Error: can't find library: " + str( lib ) )
Exit(-1)
return False
for x in libs:
checkLib( x )
env = conf.Finish()
env.Program(target = './benchmark', source = 'core/benchmark.cc')
env.Program('bench-report', ["report/report.cc",
"report/CSVFormatter.cc",
"report/Formatter.cc"])