-
Notifications
You must be signed in to change notification settings - Fork 0
/
Sconstruct
44 lines (34 loc) · 917 Bytes
/
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
#!/usr/bin/python
import os
import platform
AddOption('--enable-debug',
dest='enable_debug',
nargs='?', type='string',
action='store',
const='yes',
help='enable debug build')
build_mode='release'
if GetOption('enable_debug'):
build_mode='debug'
env = Environment()
mpicxx = "/usr/bin/mpicxx"
sources = Split("""
LR_cell.cpp
LR_lattice.cpp
main.cpp
parallel.cpp
""")
env.Replace(CXX = mpicxx)
if ('release' == build_mode):
env.MergeFlags(['-O3'])
else:
env.MergeFlags(['-O0', '-g'])
if ('Linux' == platform.system()):
env.MergeFlags(['-DOS_LINUX'])
elif ('Windows' == platform.system()):
env.MergeFlags(['-DOS_WINDOWS'])
else:
raise SCons.Errors.StopError("Unknows target OS")
obj_list = env.Object(source = sources)
p = env.Program(target = 'luo3D', source = obj_list)
inst = env.Install('install',[p])