mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-30 12:16:17 +08:00
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:
@@ -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)
|
include_directories(${PX4_BOARD_DIR}/libfc-sensor-api/inc)
|
||||||
|
|
||||||
# Build libfc_sensor.so stub library automatically if not already built
|
# Build libfc_sensor.so stub library automatically if not already built
|
||||||
@@ -42,9 +48,17 @@ if(NOT EXISTS ${FC_SENSOR_LIB})
|
|||||||
execute_process(
|
execute_process(
|
||||||
COMMAND ${CMAKE_COMMAND} -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} ..
|
COMMAND ${CMAKE_COMMAND} -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} ..
|
||||||
WORKING_DIRECTORY ${PX4_BOARD_DIR}/libfc-sensor-api/build
|
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(
|
execute_process(
|
||||||
COMMAND ${CMAKE_COMMAND} --build .
|
COMMAND ${CMAKE_COMMAND} --build .
|
||||||
WORKING_DIRECTORY ${PX4_BOARD_DIR}/libfc-sensor-api/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()
|
endif()
|
||||||
|
|||||||
Reference in New Issue
Block a user