-
Notifications
You must be signed in to change notification settings - Fork 1
/
SConstruct
51 lines (32 loc) · 1.6 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
import os
import glob
def make_package(env, tag, package) :
objs = SConscript(os.path.join(package,"SConscript"), exports={'env' : env, 'tag' : tag})
return objs
# Add libs here
libs = Split( ' -lboost_regex -lboost_filesystem -lboost_system' )
env = Environment(CXX = 'clang++', ENV = {'PATH' : os.environ['PATH']}, LINKFLAGS='-fPIC', LIBS=libs)
env['ENV']['TERM'] = os.environ['TERM']
release = env.Clone()
release['CXXFLAGS'] = '-Wall -Werror -std=c++11 -O3 -fPIE'
debug = env.Clone()
debug['CXXFLAGS'] = '-Wall -Werror -std=c++11 -g -fPIE -DDEBUG_ME_SOFTLY'
packages = ['tool/generator/src', 'tool/ui/src', 'tool/tests/src', 'tool/emitter/src', 'tool/emitter/internal/src']
# Objects
d_objs = [make_package(debug, 'dbg', p) for p in packages]
r_objs = [make_package(release, 'rel', p) for p in packages]
# Targets
d_target = debug.Program('proteus-dbg', d_objs)
r_target = release.Program('proteus', r_objs)
#library
linkflags = ' `pkg-config --libs pocketsphinx` ' + ' `pkg-config --libs portaudio-2.0` -fpic'
libenv = Environment(CXX = 'clang++', ENV = {'PATH' : os.environ['PATH']}, LINKFLAGS=linkflags)
libenv['ENV']['TERM'] = os.environ['TERM']
libenv['CXXFLAGS'] = '-Wall -Werror -fpic -std=c++11 -g -I/usr/include/sphinxbase -I/usr/include/pocketsphinx -I/usr/include/x86_64-linux-gnu -I/usr/include/x86_64-linux-gnu/sphinxbase '
lib_packages = ['lib/src', 'lib/recorder/src']
lib_objs = [make_package(libenv, 'lib', p) for p in lib_packages]
l_target = libenv.SharedLibrary("proteus", lib_objs)
#Aliases
libenv.Alias('lib', [l_target])
release.Alias('tool', [r_target])
debug.Alias('debug', [d_target])