-
Notifications
You must be signed in to change notification settings - Fork 0
/
SConstruct
62 lines (38 loc) · 1.11 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/usr/bin/env python
import methods
import sys
import os
import os.path
executable_name = 'brain_test'
executable_dir = '#bin'
# -----------
""" Get Arguments """
target = ARGUMENTS.get('target', "debug")
verbose = ARGUMENTS.get('verbose', False)
debug = target == 'debug'
env = Environment()
""" Create directories """
Execute(Mkdir('bin'))
""" Project building """
env.executable_name = executable_name
env.executable_dir = executable_dir
env.debug = debug
env.__class__.add_source_files = methods.add_source_files
env.__class__.add_library = methods.add_library
env.__class__.add_program = methods.add_program
env.__class__.disable_warnings = methods.disable_warnings
# default include path
env.Append(CPPPATH=[ '#' ])
if not verbose:
methods.no_verbose(sys, env)
if debug:
env.Append(CPPDEFINES=['DEBUG_ENABLED'])
env.Append(CCFLAGS=['-ggdb'])
env.Append(LIBPATH=[executable_dir])
Export('env')
""" Script executions """
SConscript("brain/SCsub")
""" Build test main """
if env.debug:
executable_name += '.debug'
env.add_program(env.executable_dir + '/' + executable_name, ['main.cpp'])