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

Commit 6e6779f

Browse files
committed
build on mac AND linux, also gotta not use these python files
1 parent 79dbfc1 commit 6e6779f

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

can/packer_pyx_setup.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ def get_ext_filename(self, ext_name):
3939
if ARCH == "aarch64":
4040
extra_compile_args += ["-Wno-deprecated-register"]
4141

42+
if platform.system() == "Darwin":
43+
libdbc = "libdbc.dylib"
44+
else:
45+
libdbc = "libdbc.so"
4246

4347
setup(name='CAN packer',
4448
cmdclass={'build_ext': BuildExtWithoutPlatformSuffix},
@@ -52,8 +56,9 @@ def get_ext_filename(self, ext_name):
5256
BASEDIR,
5357
os.path.join(BASEDIR, 'phonelibs', 'capnp-cpp/include'),
5458
],
55-
libraries=["dbc"],
56-
library_dirs=["."],
59+
extra_link_args=[
60+
os.path.join(BASEDIR, 'opendbc', 'can', libdbc),
61+
],
5762
)
5863
),
5964
nthreads=4,

can/parser_pyx_setup.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ def get_ext_filename(self, ext_name):
3939
if ARCH == "aarch64":
4040
extra_compile_args += ["-Wno-deprecated-register"]
4141

42+
if platform.system() == "Darwin":
43+
libdbc = "libdbc.dylib"
44+
else:
45+
libdbc = "libdbc.so"
46+
4247
setup(name='CAN parser',
4348
cmdclass={'build_ext': BuildExtWithoutPlatformSuffix},
4449
ext_modules=cythonize(
@@ -51,8 +56,9 @@ def get_ext_filename(self, ext_name):
5156
BASEDIR,
5257
os.path.join(BASEDIR, 'phonelibs', 'capnp-cpp/include'),
5358
],
54-
libraries=["dbc"],
55-
library_dirs=["."],
59+
extra_link_args=[
60+
os.path.join(BASEDIR, 'opendbc', 'can', libdbc),
61+
],
5662
)
5763
),
5864
nthreads=4,

0 commit comments

Comments
 (0)