forked from commaai/opendbc
-
Notifications
You must be signed in to change notification settings - Fork 1
/
SConscript
23 lines (18 loc) · 857 Bytes
/
SConscript
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Import('env', 'envCython', 'common', 'arch')
envDBC = env.Clone()
dbc_file_path = '-DDBC_FILE_PATH=\'"%s"\'' % (envDBC.Dir("../dbc").abspath)
envDBC['CXXFLAGS'] += [dbc_file_path]
src = ["dbc.cc", "parser.cc", "packer.cc", "common.cc"]
# shared library for openpilot
LINKFLAGS = envDBC["LINKFLAGS"]
if arch == "Darwin":
LINKFLAGS += ["-Wl,-install_name,@loader_path/libdbc.dylib"]
libdbc = envDBC.SharedLibrary('libdbc', src, LIBS=[common, ], LINKFLAGS=LINKFLAGS)
# Build packer and parser
lenv = envCython.Clone()
lenv["LIBPATH"].append(Dir("."))
lenv["RPATH"] = [libdbc[0].dir.abspath, ]
parser = lenv.Program('parser_pyx.so', 'parser_pyx.pyx', LIBS=[common, libdbc[0].name])
packer = lenv.Program('packer_pyx.so', 'packer_pyx.pyx', LIBS=[common, libdbc[0].name])
opendbc_python = Alias("opendbc_python", [parser, packer])
Export('opendbc_python')