You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
50 lines
1015 B
50 lines
1015 B
5 years ago
|
import os
|
||
|
import subprocess
|
||
|
|
||
|
zmq = 'zmq'
|
||
|
arch = subprocess.check_output(["uname", "-m"], encoding='utf8').rstrip()
|
||
|
|
||
|
cereal_dir = Dir('.')
|
||
|
|
||
|
cpppath = [
|
||
|
cereal_dir,
|
||
|
'/usr/lib/include',
|
||
|
]
|
||
|
|
||
|
AddOption('--test',
|
||
|
action='store_true',
|
||
|
help='build test files')
|
||
|
|
||
|
AddOption('--asan',
|
||
|
action='store_true',
|
||
|
help='turn on ASAN')
|
||
|
|
||
|
ccflags_asan = ["-fsanitize=address", "-fno-omit-frame-pointer"] if GetOption('asan') else []
|
||
|
ldflags_asan = ["-fsanitize=address"] if GetOption('asan') else []
|
||
|
|
||
|
env = Environment(
|
||
|
ENV=os.environ,
|
||
|
CC='clang',
|
||
|
CXX='clang++',
|
||
|
CCFLAGS=[
|
||
|
"-g",
|
||
|
"-fPIC",
|
||
|
"-O2",
|
||
|
"-Werror=implicit-function-declaration",
|
||
|
"-Werror=incompatible-pointer-types",
|
||
|
"-Werror=int-conversion",
|
||
|
"-Werror=return-type",
|
||
|
"-Werror=format-extra-args",
|
||
|
] + ccflags_asan,
|
||
|
LDFLAGS=ldflags_asan,
|
||
|
LINKFLAGS=ldflags_asan,
|
||
|
|
||
|
CFLAGS="-std=gnu11",
|
||
|
CXXFLAGS="-std=c++14",
|
||
|
CPPPATH=cpppath,
|
||
|
)
|
||
|
|
||
|
|
||
|
Export('env', 'zmq', 'arch')
|
||
|
SConscript(['SConscript'])
|