-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathSConstruct
53 lines (45 loc) · 1.64 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
import os
buildType = 'debug'
include = '#build/$BUILDTYPE/include'
lib = '#build/$BUILDTYPE/lib'
env = Environment(BUILDTYPE = buildType,
CPPPATH = [include],
LIBPATH = [lib])
env.Append(CCFLAGS = "-g -std=c++14")
env.Append(CCFLAGS = ["-pedantic"
, "-ffunction-sections"
, "-Wall"
, "-Wextra"
, "-Wcast-align"
, "-Wcast-qual"
, "-Wctor-dtor-privacy"
, "-Wdisabled-optimization"
, "-Wformat=2"
, "-Winit-self"
, "-Wno-undefined-inline"
, "-Wno-undefined-internal"
, "-Wmissing-include-dirs"
, "-Wold-style-cast"
, "-Woverloaded-virtual"
, "-Wredundant-decls"
, "-Wshadow"
, "-Wsign-conversion"
, "-Wsign-promo"
, "-Wstrict-overflow=5"
, "-Wswitch-default"
, "-Wundef"
, "-Werror"])
compiler = 'clang++'
#compiler = 'g++'
if 'CXX' in os.environ and os.environ['CXX']:
compiler = os.environ['CXX']
env.Replace(CXX = compiler)
if compiler[:5] == 'clang':
env.Append(CCFLAGS = "-stdlib=libc++")
env.Append(LINKFLAGS = "-lc++")
else:
env.Append(CCFLAGS = "-Wno-sign-conversion")
env['PROJNAME'] = os.path.basename(Dir('.').srcnode().abspath)
print env['PROJNAME']
Export('env')
env.SConscript('src/SConscript', variant_dir='build/$BUILDTYPE')