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

Commit e25bba7

Browse files
committed
no need to double build the objects
1 parent fe43a99 commit e25bba7

File tree

1 file changed

+10
-16
lines changed

1 file changed

+10
-16
lines changed

SConscript

+10-16
Original file line numberDiff line numberDiff line change
@@ -21,46 +21,40 @@ if shutil.which('capnpc-java'):
2121
'capnpc $SOURCES --src-prefix=cereal -o java:' + gen_dir.path + '/java/')
2222

2323
# TODO: remove non shared cereal and messaging
24-
env.Library('cereal', [
24+
cereal_objects = env.SharedObject([
2525
'gen/c/car.capnp.c',
2626
'gen/c/log.capnp.c',
2727
'gen/cpp/car.capnp.c++',
2828
'gen/cpp/log.capnp.c++',
2929
])
3030

31-
env.SharedLibrary('cereal_shared', [
32-
'gen/c/car.capnp.c',
33-
'gen/c/log.capnp.c',
34-
'gen/cpp/car.capnp.c++',
35-
'gen/cpp/log.capnp.c++',
36-
])
31+
env.Library('cereal', cereal_objects)
32+
env.SharedLibrary('cereal_shared', cereal_objects)
3733

3834
cereal_dir = Dir('.')
3935
env.Command(
4036
['services.h'],
4137
['service_list.yaml', 'services.py'],
4238
'python3 ' + cereal_dir.path + '/services.py > $TARGET')
4339

44-
messaging_deps = [
40+
messaging_objects = env.SharedObject([
4541
'messaging/messaging.cc',
4642
'messaging/impl_zmq.cc',
4743
'messaging/impl_msgq.cc',
4844
'messaging/msgq.cc',
49-
]
45+
])
5046

51-
messaging_lib = env.Library('messaging', messaging_deps)
47+
messaging_lib = env.Library('messaging', messaging_objects)
5248

5349
# note, this rebuilds the deps shared, zmq is statically linked to make APK happy
54-
shared_lib_shared_lib = [zmq, 'm', 'stdc++']
55-
if arch == "aarch64":
56-
shared_lib_shared_lib.append("gnustl_shared")
57-
messaging_shared_lib = env.SharedLibrary('messaging_shared', messaging_deps, LIBS=shared_lib_shared_lib)
58-
env.Command(['messaging/messaging.so'], [messaging_shared_lib], "chmod 777 $SOURCES && ln -sf `realpath $SOURCES` $TARGET")
50+
# TODO: get APK to load system zmq to remove the static link
51+
shared_lib_shared_lib = [zmq, 'm', 'stdc++'] + ["gnustl_shared"] if arch == "aarch64" else []
52+
env.SharedLibrary('messaging_shared', messaging_objects, LIBS=shared_lib_shared_lib)
5953

6054
env.Program('messaging/bridge', ['messaging/bridge.cc'], LIBS=[messaging_lib, 'zmq'])
6155

6256
# different target?
63-
#env.Program('messaging/demo', ['messaging/demo.cc'], LIBS=['messaging', 'zmq'])
57+
#env.Program('messaging/demo', ['messaging/demo.cc'], LIBS=[messaging_lib, 'zmq'])
6458

6559

6660
env.Command(['messaging/messaging_pyx.so'],

0 commit comments

Comments
 (0)