-
Notifications
You must be signed in to change notification settings - Fork 1
/
SConstruct
30 lines (22 loc) · 1.01 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
#Default construction environment
import os
mydir = os.getcwd()
#Set default C++ building flags for both libraries and executables
default_env = Environment(ENV = os.environ)
default_env.Append(CPPPATH = [mydir + '/include'])
default_env.Append(CFLAGS = ' -Wall -std=gnu11')
default_env.Append(CXXFLAGS = ' -Wall -std=gnu++14')
default_env.Append(CFLAGS = ' -O0 -g -DARCH_X86_64')
default_env.Append(CXXFLAGS = ' -O0 -g -DARCH_X86_64')
default_env.LibDest = mydir + '/lib'
default_env.BinDest = mydir + '/bin'
default_env.IncDest = mydir + '/include'
#Set linking flags for executables
bin_env = default_env.Clone()
bin_env.Append(LIBPATH = [bin_env.LibDest])
bin_env.Append(LINKFLAGS = ['-Wl,-rpath,'+bin_env.LibDest])
#set linking flags for libraries
lib_env = default_env.Clone()
lib_env.Append(LINKFLAGS = ['-fPIC'])
SConscript('src/SConscript', exports='bin_env lib_env', variant_dir='build/reprint', duplicate = 0)
SConscript('tests/SConscript', exports='bin_env lib_env', variant_dir='build/examples', duplicate = 0)