From 7a44ee7429161eb1cf5aeb2af0cf919efb55ccac Mon Sep 17 00:00:00 2001 From: Mark Charlebois Date: Fri, 29 Apr 2016 16:09:47 -0700 Subject: [PATCH] Added support for external shared libraries The FC_ADDON drivers are shared libraries that have PX4 wrappers. The wrappers are built as modules which are static libraries and cannot have shared library dependencies. The shared libraries are required to resolve the symbols at runtime and need to be linked with the libmainapp shared library. Signed-off-by: Mark Charlebois --- CMakeLists.txt | 3 +++ src/firmware/qurt/CMakeLists.txt | 2 ++ 2 files changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index f9e11ee448..5c2e1ae5f0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -348,6 +348,9 @@ foreach(module ${config_module_list}) #message(STATUS "adding module: ${module}") endforeach() +# Keep track of external shared libs required for modules +set(module_shared_libraries "${module_shared_libraries}" CACHE INTERNAL "module_shared_libraries") + add_subdirectory(src/firmware/${OS}) #add_dependencies(df_driver_framework nuttx_export_${CONFIG}.stamp) diff --git a/src/firmware/qurt/CMakeLists.txt b/src/firmware/qurt/CMakeLists.txt index 29046e54bb..bacebe70ef 100644 --- a/src/firmware/qurt/CMakeLists.txt +++ b/src/firmware/qurt/CMakeLists.txt @@ -34,6 +34,7 @@ else() message("module_libraries = ${module_libraries}") message("target_libraries = ${target_libraries}") message("df_driver_libs = ${df_driver_libs}") + message("module_external_libraries = ${module_external_libraries}") # Generate the DSP lib and stubs but not the apps side executable # The Apps side executable is generated via the posix_eagle_xxxx target QURT_LIB(LIB_NAME mainapp @@ -45,6 +46,7 @@ else() ${target_libraries} ${df_driver_libs} m + ${module_external_libraries} ) px4_add_adb_push(OUT upload