rebuild cython extensions when python/cython/distuils change
parent
2265c9c3dc
commit
9ee0069ecc
|
@ -14,4 +14,3 @@ can/packer_pyx.cpp
|
||||||
can/parser_pyx.cpp
|
can/parser_pyx.cpp
|
||||||
can/packer_pyx.html
|
can/packer_pyx.html
|
||||||
can/parser_pyx.html
|
can/parser_pyx.html
|
||||||
can/packer_impl.cpp
|
|
||||||
|
|
|
@ -1,9 +1,16 @@
|
||||||
|
import Cython
|
||||||
|
import distutils
|
||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
|
import sys
|
||||||
|
|
||||||
zmq = 'zmq'
|
zmq = 'zmq'
|
||||||
arch = subprocess.check_output(["uname", "-m"], encoding='utf8').rstrip()
|
arch = subprocess.check_output(["uname", "-m"], encoding='utf8').rstrip()
|
||||||
|
|
||||||
|
# Rebuild cython extensions if python, distutils, or cython change
|
||||||
|
cython_dependencies = [Value(v) for v in (sys.version, distutils.__version__, Cython.__version__)]
|
||||||
|
Export('cython_dependencies')
|
||||||
|
|
||||||
cereal_dir = Dir('.')
|
cereal_dir = Dir('.')
|
||||||
|
|
||||||
cpppath = [
|
cpppath = [
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
Import('env', 'cereal')
|
Import('env', 'cereal', 'cython_dependencies')
|
||||||
|
|
||||||
import os
|
import os
|
||||||
from opendbc.can.process_dbc import process
|
from opendbc.can.process_dbc import process
|
||||||
|
@ -17,7 +17,6 @@ for x in sorted(os.listdir('../')):
|
||||||
libdbc = env.SharedLibrary('libdbc', ["dbc.cc", "parser.cc", "packer.cc", "common.cc"]+dbcs, LIBS=["capnp", "kj"])
|
libdbc = env.SharedLibrary('libdbc', ["dbc.cc", "parser.cc", "packer.cc", "common.cc"]+dbcs, LIBS=["capnp", "kj"])
|
||||||
|
|
||||||
# Build packer and parser
|
# Build packer and parser
|
||||||
|
env.Command(['packer_pyx.so', 'packer_pyx.cpp', 'parser_pyx.so', 'parser_pyx.cpp'],
|
||||||
env.Command(['packer_pyx.so', 'parser_pyx.so'],
|
cython_dependencies + [libdbc, cereal, 'common_pyx_setup.py', 'common.pxd', 'packer_pyx.pyx', 'parser_pyx.pyx'],
|
||||||
[libdbc, cereal, 'common_pyx_setup.py', 'packer_pyx.pyx', 'parser_pyx.pyx', 'common.pxd'],
|
"cd opendbc/can && python3 common_pyx_setup.py build_ext --inplace")
|
||||||
"cd opendbc/can && python3 common_pyx_setup.py build_ext --inplace")
|
|
||||||
|
|
Loading…
Reference in New Issue