Skip to content

Commit

Permalink
Sconscript: enable openpilot compilation for macOS (#1059)
Browse files Browse the repository at this point in the history
* working

* fix that

* remove that

* use @loader_path instead

* multiple lines
  • Loading branch information
bongbui321 authored Jul 5, 2024
1 parent 776bca1 commit de39b14
Showing 1 changed file with 6 additions and 3 deletions.
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')

0 comments on commit de39b14

Please sign in to comment.