-
Notifications
You must be signed in to change notification settings - Fork 1
/
SConstruct
47 lines (37 loc) · 1.36 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
import os
boost_prefix = "/usr"
libs = [ 'boost_program_options', 'pthread', 'boost_system-mt', 'pugixml' ]
release_mode = ARGUMENTS.get("mode", "release")
if not (release_mode in [ "release", "debug" ]):
print "mode should be set to release or debug"
Exit(1)
releasecflags = [ "-O3" ]
debugcflags = [ "-O0", "-g", "-DDEBUG" ]
if release_mode == "release":
cflags = releasecflags
else:
cflags = debugcflags
env = Environment()
env.Append(CCFLAGS = cflags)
Export('env')
SConscript('models/SConscript')
SConscript('network/SConscript')
SConscript('core/SConscript')
SConscript('tests/SConscript')
Import('models_lib')
Import('core_lib')
Import('network_lib')
sources = env.Glob("*.cpp")
env.Append(CPPPATH = [os.path.join(boost_prefix, "include")])
env.Append(LIBPATH = [os.path.join(boost_prefix, "lib")])
env.Append(CCFLAGS = "-O3")
app = env.Program(target = "wiredto154", source = "wiredto154.cpp",
LIBS = libs + [ models_lib, core_lib, network_lib ],
CPPPATH=["."],
LIBPATH = [ 'models', 'network', 'core' ],
# the following line is a workaround to solve circular dependencies issues when linking the program
LINKFLAGS = "-Wl,-\(")
app2 = env.Program(target = "pcap-dumper",
source = "pcap-dumper.cpp",
LIBS = libs)
Default([app, app2])