mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-18 02:43:33 +08:00
Merge branch 'cmake-2' of github.com:PX4/Firmware into cmake-2-pthread
This commit is contained in:
@@ -5,17 +5,22 @@ px4_nuttx_generate_builtin_commands(
|
||||
${config_extra_builtin_cmds}
|
||||
)
|
||||
|
||||
px4_nuttx_generate_romfs(OUT romfs.o
|
||||
ROOT ROMFS/px4fmu_common)
|
||||
px4_nuttx_add_romfs(OUT romfs
|
||||
ROOT ROMFS/px4fmu_common
|
||||
EXTRAS ${CMAKE_BINARY_DIR}/src/modules/px4iofirmware/${config_io_board}_${LABEL}.bin
|
||||
)
|
||||
|
||||
add_dependencies(romfs fw_io)
|
||||
|
||||
# add executable
|
||||
add_executable(firmware_nuttx
|
||||
builtin_commands.c
|
||||
romfs.o)
|
||||
builtin_commands.c)
|
||||
|
||||
|
||||
set(nuttx_export_dir ${CMAKE_BINARY_DIR}/${BOARD}/NuttX/nuttx-export)
|
||||
|
||||
set(link_libs
|
||||
apps nuttx m gcc
|
||||
romfs apps nuttx m gcc
|
||||
)
|
||||
|
||||
if(NOT ${BOARD} STREQUAL "sim")
|
||||
@@ -56,7 +61,14 @@ if(NOT ${BOARD} STREQUAL "sim")
|
||||
configure_file(gdbinit.in .gdbinit)
|
||||
|
||||
add_custom_target(debug
|
||||
COMMAND ${GDB} ${CMAKE_CURRENT_BINARY_DIR}/firmware_nuttx
|
||||
COMMAND ${GDBTUI} ${CMAKE_CURRENT_BINARY_DIR}/firmware_nuttx
|
||||
DEPENDS firmware_nuttx
|
||||
${CMAKE_CURRENT_BINARY_DIR}/.gdbinit
|
||||
)
|
||||
|
||||
add_custom_target(debug_io
|
||||
COMMAND ${GDBTUI}
|
||||
${CMAKE_BINARY_DIR}/src/modules/px4iofirmware/${config_io_board}_${LABEL}
|
||||
DEPENDS firmware_nuttx
|
||||
${CMAKE_CURRENT_BINARY_DIR}/.gdbinit
|
||||
)
|
||||
|
||||
@@ -103,10 +103,12 @@ elseif(${config_io_board} STREQUAL "px4io-v2")
|
||||
)
|
||||
endif()
|
||||
|
||||
add_executable(firmware_io_nuttx
|
||||
set(fw_io_name ${config_io_board}_${LABEL})
|
||||
|
||||
add_executable(${fw_io_name}
|
||||
${srcs})
|
||||
|
||||
add_dependencies(firmware_io_nuttx
|
||||
add_dependencies(${fw_io_name}
|
||||
nuttx_export_${config_io_board}
|
||||
msg_gen
|
||||
io_prebuild_targets
|
||||
@@ -119,20 +121,20 @@ set(main_link_flags
|
||||
"-Wl,-Map=${CMAKE_BINARY_DIR}/${config_io_board}/main.map"
|
||||
)
|
||||
px4_join(OUT main_link_flags LIST ${main_link_flags} GLUE " ")
|
||||
set_target_properties(firmware_io_nuttx PROPERTIES LINK_FLAGS ${main_link_flags})
|
||||
set_target_properties(${fw_io_name} PROPERTIES LINK_FLAGS ${main_link_flags})
|
||||
|
||||
set(io_fw_file ${CMAKE_CURRENT_BINARY_DIR}/${config_io_board}.px4)
|
||||
|
||||
target_link_libraries(firmware_io_nuttx
|
||||
target_link_libraries(${fw_io_name}
|
||||
-Wl,--start-group
|
||||
apps nuttx nosys m gcc
|
||||
${config_io_extra_libs}
|
||||
-Wl,--end-group)
|
||||
|
||||
px4_nuttx_add_firmware(OUT ${io_fw_file}
|
||||
BOARD ${config_io_board}
|
||||
EXE ${CMAKE_CURRENT_BINARY_DIR}/firmware_io_nuttx
|
||||
${config_firmware_options}
|
||||
px4_nuttx_create_bin(OUT ${CMAKE_CURRENT_BINARY_DIR}/${fw_io_name}.bin
|
||||
EXE ${fw_io_name}
|
||||
)
|
||||
|
||||
add_custom_target(fw_io
|
||||
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${fw_io_name}.bin)
|
||||
|
||||
|
||||
# vim: set noet ft=cmake fenc=utf-8 ff=unix :
|
||||
|
||||
Reference in New Issue
Block a user