Skip to content
This repository has been archived by the owner on Apr 13, 2024. It is now read-only.

Commit

Permalink
build on mac
Browse files Browse the repository at this point in the history
  • Loading branch information
geohot committed Dec 15, 2019
1 parent 4f82d01 commit 79dbfc1
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
*.pyc
*.os
*.tmp
*.dylib
.*.swp
can/*.so
can/build/
Expand Down
10 changes: 7 additions & 3 deletions can/packer_pyx_setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os
import sysconfig
import subprocess
import platform
from distutils.core import Extension, setup # pylint: disable=import-error,no-name-in-module

from Cython.Build import cythonize
Expand Down Expand Up @@ -51,10 +52,13 @@ def get_ext_filename(self, ext_name):
BASEDIR,
os.path.join(BASEDIR, 'phonelibs', 'capnp-cpp/include'),
],
extra_link_args=[
os.path.join(BASEDIR, 'opendbc', 'can', 'libdbc.so'),
],
libraries=["dbc"],
library_dirs=["."],
)
),
nthreads=4,
)

if platform.system() == "Darwin":
os.system("install_name_tool -change opendbc/can/libdbc.dylib "+BASEDIR+"/opendbc/can/libdbc.dylib packer_pyx.so")

10 changes: 7 additions & 3 deletions can/parser_pyx_setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os
import subprocess
import sysconfig
import platform
from distutils.core import Extension, setup # pylint: disable=import-error,no-name-in-module

from Cython.Build import cythonize
Expand Down Expand Up @@ -50,10 +51,13 @@ def get_ext_filename(self, ext_name):
BASEDIR,
os.path.join(BASEDIR, 'phonelibs', 'capnp-cpp/include'),
],
extra_link_args=[
os.path.join(BASEDIR, 'opendbc', 'can', 'libdbc.so'),
],
libraries=["dbc"],
library_dirs=["."],
)
),
nthreads=4,
)

if platform.system() == "Darwin":
os.system("install_name_tool -change opendbc/can/libdbc.dylib "+BASEDIR+"/opendbc/can/libdbc.dylib parser_pyx.so")

0 comments on commit 79dbfc1

Please sign in to comment.