-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathSConstruct
More file actions
30 lines (28 loc) · 996 Bytes
/
Copy pathSConstruct
File metadata and controls
30 lines (28 loc) · 996 Bytes
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
import glob
import os
from argparse import ArgumentParser
debug = ARGUMENTS.get('debug',0)
source = ARGUMENTS.get('source',None)
target = ARGUMENTS.get('target',None)
compiler = ARGUMENTS.get('compiler','g++')
if compiler=='g++':
cflags = '-Wfatal-errors'
if int(debug):
cflags +=' -O0 -g -pg -DDEBUG_MODE'
else:
cflags+=' -O3'
elif compiler=='clang++':
cflags = '-Weverything -Werror -ferror-limit=1 -Wno-error=padded'
if int(debug):
cflags += ' -O0 -g -pg -DDEBUG_MODE'
else:
cflags += ' -O3 -march=native'
env = Environment(ENV = os.environ,
CXX=compiler,
CPPPATH=os.environ['FUJIN_ROOT']+'/source',
LIBPATH=['.',os.environ['HDF5_LIB_PATH']],
LIBS=['fujin','hdf5','hdf5_cpp'],
CXXFLAGS=cflags)
lib_file = env.Library('fujin',glob.glob(os.environ['FUJIN_ROOT']+'/source/*.cpp'))
if None!=source and None!=target:
env.Program(target,[source])