openpilot is an open source driver assistance system. openpilot performs the functions of Automated Lane Centering and Adaptive Cruise Control for over 200 supported car makes and models.
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.
 
 
 
 
 
 

27 lines
898 B

Import('env', 'cereal')
import os
from opendbc.can.process_dbc import process
dbcs = []
for x in sorted(os.listdir('../')):
if x.endswith(".dbc"):
def compile_dbc(target, source, env):
process(source[0].path, target[0].path)
in_fn = [os.path.join('../', x), 'dbc_template.cc']
out_fn = os.path.join('dbc_out', x.replace(".dbc", ".cc"))
dbc = env.Command(out_fn, in_fn, compile_dbc)
dbcs.append(dbc)
libdbc = env.SharedLibrary('libdbc', ["dbc.cc", "parser.cc", "packer.cc", "common.cc"]+dbcs, LIBS=["capnp", "kj"])
# packer
env.Command(['packer_pyx.so'],
[libdbc, 'packer_pyx.pyx', 'packer_pyx_setup.py'],
"cd opendbc/can && python3 packer_pyx_setup.py build_ext --inplace")
# parser
env.Command(['parser_pyx.so'],
[libdbc, cereal, 'parser_pyx_setup.py', 'parser_pyx.pyx', 'common.pxd'],
"cd opendbc/can && python3 parser_pyx_setup.py build_ext --inplace")