-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSConstruct
31 lines (28 loc) · 1.08 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
# -*- python -*-
# see LICENSE.md for license.
from glob import glob
from os.path import join as pathjoin
ccflags = ['-Wall', '-std=c++11']
cppdefines = [('_FILE_OFFSET_BITS', 64)]
linkflags = []
if ARGUMENTS.get('debug', 0):
ccflags.extend(['-g', '-O0'])
cppdefines.append('DENSITY_SHOW')
cppdefines.append(('DENSITY_INLINE', ''))
else:
ccflags.extend(['-O3', '-flto', '-Ofast'])
cppdefines.append(('DENSITY_INLINE', 'inline __attribute__((always_inline))'))
if ARGUMENTS.get('prof', 0):
ccflags.extend(['-pg', '-fprofile-arcs', '-ftest-coverage'])
linkflags.extend(['-pg', '-fprofile-arcs', '-ftest-coverage'])
else:
ccflags.append('-fomit-frame-pointer')
env = Environment(CCFLAGS = ccflags,
CPPDEFINES = cppdefines,
CPPPATH = ['.'],
LINKFLAGS = linkflags,
PROGSUFFIX = '.exe')
objs = map(lambda src: env.Object(src)[0], glob(pathjoin('densityxx', '*.cpp')))
env.Program('sharcxx', glob(pathjoin('sharcxx', '*.cpp')) + objs)
env.Program('showsz', 'showsz.cpp')
env.Object('compile', 'compile.cxx')