-
Notifications
You must be signed in to change notification settings - Fork 0
/
sconstruct
executable file
·36 lines (29 loc) · 1.03 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
# -*- python -*-
vars = Variables()
vars.Add(
EnumVariable('BUILD_TYPE', 'Set build type', 'debug',
allowed_values=('debug_max', 'debug', 'release_debug', 'release'),
ignorecase=2)
)
env = Environment(variables = vars)
env.Append(CCFLAGS='-Wall -Wconversion -Wno-register -fpermissive')
env.Append(CXXFLAGS='-std=c++17')
if env['BUILD_TYPE'] == 'debug_max':
env.Append(CPPDEFINES=['DEBUG_MAX'])
env.Append(CXXFLAGS='-g -O0')
elif env['BUILD_TYPE'] == 'debug':
env.Append(CPPDEFINES=['DEBUG'])
env.Append(CXXFLAGS='-g -O1')
elif env['BUILD_TYPE'] == 'release_debug':
env.Append(CPPDEFINES=['RELEASE_DEBUG'])
env.Append(CXXFLAGS='-g -O2')
elif env['BUILD_TYPE'] == 'release':
env.Append(CPPDEFINES=['RELEASE', 'NDEBUG'])
env.Append(CXXFLAGS='-g0 -s -Ofast -ffast-math')
import sys
if not sys.platform.startswith('cygwin'):
env.Append(LINKFLAGS='-static')
Help(vars.GenerateHelpText(env))
Export('env')
SConscript('src/sconscript', variant_dir='build', duplicate=0)
#SConscript('tests/sconscript')