From de39b143a31cd29b4df4c0cbba71316c1bc8e71b Mon Sep 17 00:00:00 2001 From: Hoang Bui <47828508+bongbui321@users.noreply.github.com> Date: Fri, 5 Jul 2024 14:46:35 -0400 Subject: [PATCH] Sconscript: enable openpilot compilation for macOS (#1059) * working * fix that * remove that * use @loader_path instead * multiple lines --- can/SConscript | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/can/SConscript b/can/SConscript index 7e8fd270f6..63654ac863 100644 --- a/can/SConscript +++ b/can/SConscript @@ -1,4 +1,4 @@ -Import('env', 'envCython', 'cereal', 'common') +Import('env', 'envCython', 'cereal', 'common', 'arch') import os @@ -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) @@ -25,4 +28,4 @@ lenv.Depends(packer, libdbc) opendbc_python = Alias("opendbc_python", [parser, packer]) -Export('opendbc_python') \ No newline at end of file +Export('opendbc_python')