mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-18 04:33:33 +08:00
ROMFS list files explicitly instead of using GLOB_RECURSE (#9107)
* Lists ROMFS files explicity instead of using GLOB_RECURSE
Previously, when ROMFS files that were not airframes were touched, the ROMFS
would not be rebuilt. The ROMFS files are now specified explicityl in a
CMakeLists.txt file that is located in the root ROMFS directory.
Now when one of the ROMFS files is touched the whole ROMFS is rebuilt.
When new files are added to the ROMFS, they need to be explicity added to
the CMakeLists in the ROMFS root directory.
* ROMFS: adds individual CMakeLists files in each subdirectory
Also moves the temporary ROMFS build directory to ${PX4_BINARY_DIR}/ROMFS/genromfs
so that the cmake_install.cmake files and the CMakeFiles directories (generated whenever
are not add_subdirectory() is called) are not generated in the temporary ROMFS directory
from which the ROMFS binary is created.
* cmake ROMFS generate add px4_add_romfs_files function
* ROMFS CMakeLists: adds explanatory comment to px4_add_romfs_files function
* ROMFS CMakeLists: updates copyright headers
This commit is contained in:
@@ -49,7 +49,7 @@ px4_add_module(
|
||||
message(STATUS "Building and including ${config_io_board}")
|
||||
|
||||
set(fw_io_exe "${PX4_SOURCE_DIR}/build/${config_io_board}_default/nuttx_${config_io_board}_default.elf")
|
||||
set(fw_io_bin "${PX4_BINARY_DIR}/ROMFS/${config_romfs_root}/extras/${config_io_board}.bin")
|
||||
set(fw_io_bin "${PX4_BINARY_DIR}/genromfs/${config_romfs_root}/extras/${config_io_board}.bin")
|
||||
|
||||
file(GLOB_RECURSE px4io_driver_files ${PX4_SOURCE_DIR}/src/drivers/boards/${config_io_board}/*)
|
||||
file(GLOB_RECURSE px4io_config_files ${PX4_SOURCE_DIR}/platforms/nuttx/NuttX/configs/${config_io_board}/*)
|
||||
@@ -68,7 +68,7 @@ file(RELATIVE_PATH fw_io_bin_relative ${CMAKE_CURRENT_BINARY_DIR} ${fw_io_bin})
|
||||
set(fw_io_bin ${fw_io_bin} PARENT_SCOPE)
|
||||
|
||||
add_custom_command(OUTPUT ${fw_io_bin}
|
||||
COMMAND mkdir -p ${PX4_BINARY_DIR}/ROMFS/${config_romfs_root}/extras/
|
||||
COMMAND mkdir -p ${PX4_BINARY_DIR}/genromfs/${config_romfs_root}/extras/
|
||||
COMMAND ${OBJCOPY} -O binary ${fw_io_exe_relative} ${fw_io_bin_relative}
|
||||
DEPENDS ${fw_io_exe}
|
||||
COMMENT "Copying ${config_io_board} to ROMFS extras"
|
||||
|
||||
Reference in New Issue
Block a user