-
Notifications
You must be signed in to change notification settings - Fork 0
/
SConstruct
44 lines (36 loc) · 1022 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
43
AddOption(
'--dbg',
action='store_true',
help='Debug build',
default=False)
AddOption(
'--odbg',
action='store_true',
help='Optimised build with debug symbols',
default=False)
AddOption(
'--pg',
action='store_true',
help='Enable profiling',
default=False)
extra_ccflags = []
extra_ldflags = []
extra_libs = []
if GetOption('dbg'):
extra_ccflags += ['-g', '-DAFK_GL_DEBUG=1']
variant_dir = 'build/debug'
elif GetOption('odbg'):
extra_ccflags += ['-O3', '-g', '-DAFK_GL_DEBUG=1']
variant_dir = 'build/odbg'
else:
extra_ccflags += ['-O3', '-DNDEBUG']
variant_dir = 'build/release'
if GetOption('pg'):
extra_ccflags += ['-pg']
extra_ldflags += ['-pg']
variant_dir += '_pg'
# TODO Restrict this to Linux.
# On Windows, instead apply -DAFK_WGL. On Mac, -DAFK_CGL or somesuch.
extra_ccflags += ['-DAFK_GLX']
extra_libs += ['-lX11']
SConscript('src/SConscript', variant_dir=variant_dir, exports='extra_ccflags extra_ldflags extra_libs')