From aeeb4e47a5b33f1dde15f96b9690d31917bd5b98 Mon Sep 17 00:00:00 2001 From: Jukka Laitinen Date: Mon, 11 Jan 2021 09:59:17 +0200 Subject: [PATCH] Fix parameters building for nuttx protected/kernel builds - Don't link to px4_layer - Don't link to flashparams; flashparams would work only in kernel side - Add missing link to px4_platform TODO: Make flashparams to work also in protected/kernel build. This would require using some real OS interface to the flash Signed-off-by: Jukka Laitinen fix: bc2f28a68479e4f41017a7d254a263e9e3db5c1e Fix parameters building for nuttx protected/kernel builds Signed-off-by: Jukka Laitinen --- src/lib/parameters/CMakeLists.txt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/lib/parameters/CMakeLists.txt b/src/lib/parameters/CMakeLists.txt index 64bde57971..4c355cdd9d 100644 --- a/src/lib/parameters/CMakeLists.txt +++ b/src/lib/parameters/CMakeLists.txt @@ -148,7 +148,13 @@ if (NOT "${PX4_BOARD}" MATCHES "px4_io") px4_parameters.hpp ) - target_link_libraries(parameters PRIVATE perf tinybson px4_layer) + target_link_libraries(parameters PRIVATE perf tinybson px4_platform) + + # on NuttX protected build there are separate px4 layers for userspace and kernel + if (NOT ${PX4_PLATFORM} STREQUAL "nuttx" OR CONFIG_BUILD_FLAT) + target_link_libraries(parameters PRIVATE px4_layer) + endif() + target_compile_definitions(parameters PRIVATE -DMODULE_NAME="parameters") target_compile_options(parameters PRIVATE @@ -160,7 +166,7 @@ else() endif() add_dependencies(parameters prebuild_targets) -if(${PX4_PLATFORM} STREQUAL "nuttx") +if(${PX4_PLATFORM} STREQUAL "nuttx" AND CONFIG_BUILD_FLAT) target_link_libraries(parameters PRIVATE flashparams tinybson) endif()