Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sconscript: enable openpilot compilation for macOS #1059

Merged
merged 5 commits into from
Jul 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions can/SConscript
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Import('env', 'envCython', 'cereal', 'common')
Import('env', 'envCython', 'cereal', 'common', 'arch')

import os

Expand All @@ -9,7 +9,10 @@ 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)
LINKFLAGS = envDBC["LINKFLAGS"]
if arch == "Darwin":
LINKFLAGS += ["-Wl,-install_name,@loader_path/libdbc.dylib"]
libdbc = envDBC.SharedLibrary('libdbc', src, LIBS=libs, LINKFLAGS=LINKFLAGS)

# static library for tools like cabana
envDBC.Library('libdbc_static', src, LIBS=libs)
Expand All @@ -25,4 +28,4 @@ lenv.Depends(packer, libdbc)

opendbc_python = Alias("opendbc_python", [parser, packer])

Export('opendbc_python')
Export('opendbc_python')