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 <jukkax@ssrc.tii.ae>

fix: bc2f28a68479e4f41017a7d254a263e9e3db5c1e    Fix parameters building for nuttx protected/kernel builds

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
This commit is contained in:
Jukka Laitinen
2021-01-11 09:59:17 +02:00
parent 01d20ba392
commit aeeb4e47a5
+8 -2
View File
@@ -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()