forked from vivaladav/cpu-stat
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSConstruct
More file actions
20 lines (16 loc) · 716 Bytes
/
Copy pathSConstruct
File metadata and controls
20 lines (16 loc) · 716 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# 3 build modes
vars = Variables()
vars.Add(EnumVariable('mode', 'Building mode', 'debug', allowed_values=('debug', 'profile', 'release')))
env = Environment(variables = vars)
Help(vars.GenerateHelpText(env))
# basic flags according to build mode
if env['mode'] == 'debug':
env.Append(CCFLAGS = ['-Wall', '-g', '-O0', '-DDEBUG'])
elif env['mode'] == 'release':
env.Append(CCFLAGS = ['-Wall', '-O3', '-DNDEBUG'])
env.Append(LINKFLAGS = ['-s'])
elif env['mode'] == 'profile':
env.Append(CCFLAGS = ['-Wall', '-pg', '-O0', '-DNDEBUG'])
env.Append(CCFLAGS = ['-std=c++11'])
# cpu-stat
SConscript('src/SConscript', exports = 'env', variant_dir = 'build/' + env['mode'], src_dir= 'src/', duplicate = 0)