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

Commit fe9fe2a

Browse files
author
Comma Device
committed
scons builds the python lib now
1 parent 2f81135 commit fe9fe2a

File tree

4 files changed

+25
-12
lines changed

4 files changed

+25
-12
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ __pycache__
66
.*.swp
77
.*.swo
88
libcereal*.a
9-
libmessaging.a
9+
libmessaging.*
1010
services.h
1111

SConscript

+21-9
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,29 @@ env.Library('cereal', [
1818
'gen/cpp/log.capnp.c++',
1919
])
2020

21-
env.Library('messaging', [
22-
'messaging/messaging.cc',
23-
'messaging/impl_zmq.cc',
24-
'messaging/impl_msgq.cc',
25-
'messaging/msgq.cc',
26-
])
27-
28-
env.Program('messaging/bridge', ['messaging/bridge.cc'], LIBS=['messaging', 'zmq'])
29-
3021
env.Command(
3122
['services.h'],
3223
['service_list.yaml', 'services.py'],
3324
'python3 cereal/services.py > $TARGET')
3425

26+
messaging_deps = [
27+
'messaging/messaging.cc',
28+
'messaging/impl_zmq.cc',
29+
'messaging/impl_msgq.cc',
30+
'messaging/msgq.cc',
31+
]
32+
33+
messaging_lib = env.Library('messaging', messaging_deps)
34+
35+
# note, this rebuilds the deps shared
36+
env.SharedLibrary('messaging', messaging_deps)
37+
38+
env.Program('messaging/bridge', ['messaging/bridge.cc'], LIBS=['messaging', 'zmq'])
39+
40+
# different target?
41+
#env.Program('messaging/demo', ['messaging/demo.cc'], LIBS=['messaging', 'zmq'])
42+
43+
env.Command(['messaging/messaging_pyx.so'],
44+
[messaging_lib, 'messaging/messaging_pyx_setup.py', 'messaging/messaging_pyx.pyx', 'messaging/messaging.pxd'],
45+
"cd cereal/messaging && python3 messaging_pyx_setup.py build_ext --inplace")
46+

messaging/.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ demo
22
bridge
33
test_runner
44
*.o
5+
*.os
56
*.d
67
*.a
78
*.so
9+
messaging_pyx.cpp

messaging/__init__.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import os
22
import subprocess
33

4-
can_dir = os.path.dirname(os.path.abspath(__file__))
5-
subprocess.check_call(["make", "-j3"], cwd=can_dir)
4+
# must be build with scons
65
from .messaging_pyx import Context, Poller, SubSocket, PubSocket # pylint: disable=no-name-in-module, import-error
76

87
from cereal import log

0 commit comments

Comments
 (0)