Skip to content

Commit

Permalink
libdbc: build both static and shared library (#786)
Browse files Browse the repository at this point in the history
  • Loading branch information
deanlee committed Mar 27, 2023
1 parent ee9f7e6 commit 1f0e04f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
.sconsign.dblite

can/*.so
can/*.a
can/build/
can/obj/
can/packer_pyx.cpp
Expand Down
9 changes: 8 additions & 1 deletion can/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,14 @@ import os
envDBC = env.Clone()
dbc_file_path = '-DDBC_FILE_PATH=\'"%s"\'' % (envDBC.Dir("..").abspath)
envDBC['CXXFLAGS'] += [dbc_file_path]
libdbc = envDBC.SharedLibrary('libdbc', ["dbc.cc", "parser.cc", "packer.cc", "common.cc"], LIBS=[common, "capnp", "kj", "zmq"])
src = ["dbc.cc", "parser.cc", "packer.cc", "common.cc"]
libs = [common, "capnp", "kj", "zmq"]

# shared library for openpilot
libdbc = envDBC.SharedLibrary('libdbc', src, LIBS=libs)

# static library for tools like cabana
envDBC.Library('libdbc_static', src, LIBS=libs)

# Build packer and parser
lenv = envCython.Clone()
Expand Down

0 comments on commit 1f0e04f

Please sign in to comment.