ci: init libfc-sensor-api submodule before building stub

The libfc-sensor-api submodule was not being initialized in CI,
causing the stub library build to fail silently. Use the existing
check_submodules.sh mechanism to ensure the submodule is fetched
before attempting to build, and add RESULT_VARIABLE checks so
cmake configuration and build failures are caught early.

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
This commit is contained in:
Ramon Roche 2026-02-11 21:18:43 -08:00
parent 731d754a15
commit d641cc3986

View File

@ -31,6 +31,12 @@
#
############################################################################
# Initialize libfc-sensor-api submodule (fetches from GitLab if not present)
execute_process(
COMMAND Tools/check_submodules.sh boards/modalai/voxl2/libfc-sensor-api
WORKING_DIRECTORY ${PX4_SOURCE_DIR}
)
include_directories(${PX4_BOARD_DIR}/libfc-sensor-api/inc)
# Build libfc_sensor.so stub library automatically if not already built
@ -42,9 +48,17 @@ if(NOT EXISTS ${FC_SENSOR_LIB})
execute_process(
COMMAND ${CMAKE_COMMAND} -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} ..
WORKING_DIRECTORY ${PX4_BOARD_DIR}/libfc-sensor-api/build
RESULT_VARIABLE FC_SENSOR_CMAKE_RESULT
)
if(NOT FC_SENSOR_CMAKE_RESULT EQUAL 0)
message(FATAL_ERROR "Failed to configure libfc_sensor stub library")
endif()
execute_process(
COMMAND ${CMAKE_COMMAND} --build .
WORKING_DIRECTORY ${PX4_BOARD_DIR}/libfc-sensor-api/build
RESULT_VARIABLE FC_SENSOR_BUILD_RESULT
)
if(NOT FC_SENSOR_BUILD_RESULT EQUAL 0)
message(FATAL_ERROR "Failed to build libfc_sensor stub library")
endif()
endif()