mirror of
https://github.com/commaai/msgq.git
synced 2026-06-11 07:24:45 +08:00
scons builds the python lib now
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -6,6 +6,6 @@ __pycache__
|
||||
.*.swp
|
||||
.*.swo
|
||||
libcereal*.a
|
||||
libmessaging.a
|
||||
libmessaging.*
|
||||
services.h
|
||||
|
||||
|
||||
30
SConscript
30
SConscript
@@ -18,17 +18,29 @@ env.Library('cereal', [
|
||||
'gen/cpp/log.capnp.c++',
|
||||
])
|
||||
|
||||
env.Library('messaging', [
|
||||
'messaging/messaging.cc',
|
||||
'messaging/impl_zmq.cc',
|
||||
'messaging/impl_msgq.cc',
|
||||
'messaging/msgq.cc',
|
||||
])
|
||||
|
||||
env.Program('messaging/bridge', ['messaging/bridge.cc'], LIBS=['messaging', 'zmq'])
|
||||
|
||||
env.Command(
|
||||
['services.h'],
|
||||
['service_list.yaml', 'services.py'],
|
||||
'python3 cereal/services.py > $TARGET')
|
||||
|
||||
messaging_deps = [
|
||||
'messaging/messaging.cc',
|
||||
'messaging/impl_zmq.cc',
|
||||
'messaging/impl_msgq.cc',
|
||||
'messaging/msgq.cc',
|
||||
]
|
||||
|
||||
messaging_lib = env.Library('messaging', messaging_deps)
|
||||
|
||||
# note, this rebuilds the deps shared
|
||||
env.SharedLibrary('messaging', messaging_deps)
|
||||
|
||||
env.Program('messaging/bridge', ['messaging/bridge.cc'], LIBS=['messaging', 'zmq'])
|
||||
|
||||
# different target?
|
||||
#env.Program('messaging/demo', ['messaging/demo.cc'], LIBS=['messaging', 'zmq'])
|
||||
|
||||
env.Command(['messaging/messaging_pyx.so'],
|
||||
[messaging_lib, 'messaging/messaging_pyx_setup.py', 'messaging/messaging_pyx.pyx', 'messaging/messaging.pxd'],
|
||||
"cd cereal/messaging && python3 messaging_pyx_setup.py build_ext --inplace")
|
||||
|
||||
|
||||
2
messaging/.gitignore
vendored
2
messaging/.gitignore
vendored
@@ -2,6 +2,8 @@ demo
|
||||
bridge
|
||||
test_runner
|
||||
*.o
|
||||
*.os
|
||||
*.d
|
||||
*.a
|
||||
*.so
|
||||
messaging_pyx.cpp
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import os
|
||||
import subprocess
|
||||
|
||||
can_dir = os.path.dirname(os.path.abspath(__file__))
|
||||
subprocess.check_call(["make", "-j3"], cwd=can_dir)
|
||||
# must be build with scons
|
||||
from .messaging_pyx import Context, Poller, SubSocket, PubSocket # pylint: disable=no-name-in-module, import-error
|
||||
|
||||
from cereal import log
|
||||
|
||||
Reference in New Issue
Block a user