cmake:bugfix fix CMake post_build phase time orderless

[1209/1210] cd cmake_out && arm-none-eabi-objcopy -O binary nuttx nuttx.bin && arm-none-eabi-objcopy -O binary nuttx vela_core1.bin && cp nuttx vela_core1.elf && cp nuttx.hex vela_core1.hex && cp nuttx.map vela_core1.mapfile
FAILED: boards/exclude_board/CMakeFiles/nuttx_post_build /home/work/ssd1/workspace/MiRTOS-car-dev-CI/cmake_out/boards/exclude_board/CMakeFiles/nuttx_post_build
cd cmake_out && arm-none-eabi-objcopy -O binary nuttx nuttx.bin && arm-none-eabi-objcopy -O binary nuttx vela_core1.bin && cp nuttx vela_core1.elf && cp nuttx.hex vela_core1.hex && cp nuttx.map vela_core1.mapfile
cp: cannot stat 'nuttx.hex': No such file or directory
[1210/1210] Generating nuttx.hex
ninja: build stopped: subcommand failed.

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
This commit is contained in:
xuxin19
2024-08-05 19:25:29 +08:00
committed by Xiang Xiao
parent b1b66ce491
commit b328b35e2b
3 changed files with 10 additions and 1 deletions

View File

@@ -423,6 +423,7 @@ include(platform)
# Setup main nuttx target ####################################################
add_executable(nuttx)
add_custom_target(nuttx_post)
if(CONFIG_BUILD_PROTECTED)
add_executable(nuttx_user)
endif()
@@ -432,6 +433,7 @@ if(CONFIG_ALLSYMS)
endif()
add_dependencies(nuttx nuttx_context)
add_dependencies(nuttx_post nuttx)
if(WIN32)
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT
@@ -573,6 +575,9 @@ add_subdirectory(boards)
# with the correct operations for that platform
if(TARGET nuttx_post_build)
# ensure thae the custom post build is executed after all steps of the nuttx
# build are completed
add_dependencies(nuttx_post_build nuttx_post)
add_custom_target(post_build ALL DEPENDS nuttx_post_build)
endif()