rebuild cython extensions when python/cython/distuils change

This commit is contained in:
Adeeb Shihadeh 2020-07-16 13:33:19 -07:00
parent f725dcd617
commit 7b78cda876
2 changed files with 11 additions and 4 deletions

View File

@ -1,4 +1,4 @@
Import('env', 'arch', 'zmq')
Import('env', 'arch', 'zmq', 'cython_dependencies')
gen_dir = Dir('gen')
messaging_dir = Dir('messaging')
@ -56,9 +56,9 @@ Depends('messaging/bridge.cc', services_h)
#env.Program('messaging/demo', ['messaging/demo.cc'], LIBS=[messaging_lib, 'zmq'])
env.Command(['messaging/messaging_pyx.so'],
[messaging_lib, 'messaging/messaging_pyx_setup.py', 'messaging/messaging_pyx.pyx', 'messaging/messaging.pxd'],
"cd " + messaging_dir.path + " && python3 messaging_pyx_setup.py build_ext --inplace")
env.Command(['messaging/messaging_pyx.so', 'messaging/messaging_pyx.cpp'],
cython_dependencies + [messaging_lib, 'messaging/messaging_pyx_setup.py', 'messaging/messaging_pyx.pyx', 'messaging/messaging.pxd'],
"cd " + messaging_dir.path + " && python3 messaging_pyx_setup.py build_ext --inplace")
if GetOption('test'):

View File

@ -1,9 +1,16 @@
import Cython
import distutils
import os
import subprocess
import sys
zmq = 'zmq'
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('.')
cpppath = [