create library for using locationd in python using ffi (#20711)

* create library for using locationd in python using ffi

* lib is not required in release

* cleanup

* dont build liblocationd on release

* add check on buffer size
This commit is contained in:
Joost Wooning
2021-04-20 17:50:40 +02:00
committed by GitHub
parent ed8acfa284
commit e08a570a13
2 changed files with 29 additions and 3 deletions
+7 -3
View File
@@ -10,9 +10,13 @@ if GetOption('kaitai'):
env.Program("ubloxd", ["ubloxd.cc", "ublox_msg.cc", "generated/ubx.cpp", "generated/gps.cpp"], LIBS=loc_libs)
ekf_sym_cc = env.Object("#rednose/helpers/ekf_sym.cc")
ekf_sym_cc = env.SharedObject("#rednose/helpers/ekf_sym.cc")
locationd_sources = ["locationd.cc", "models/live_kf.cc", ekf_sym_cc]
lenv = env.Clone()
lenv["_LIBFLAGS"] += f' {libkf[0].get_labspath()}'
locationd = lenv.Program("locationd", ["locationd.cc", "models/live_kf.cc", ekf_sym_cc],
LIBS=loc_libs + transformations)
locationd = lenv.Program("locationd", locationd_sources, LIBS=loc_libs + transformations)
lenv.Depends(locationd, libkf)
if File("liblocationd.cc").exists():
liblocationd = lenv.SharedLibrary("liblocationd", ["liblocationd.cc"] + locationd_sources, LIBS=loc_libs + transformations)
lenv.Depends(liblocationd, libkf)