mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-01 02:55:07 +08:00
NuttX quiet build
cmake combine NuttX copy and export -NuttX wasn't recopying if it fails to compile
This commit is contained in:
@@ -773,7 +773,7 @@ function(px4_create_git_hash_header)
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
)
|
||||
message(STATUS "GIT_DESC = ${git_desc}")
|
||||
#message(STATUS "GIT_DESC = ${git_desc}")
|
||||
set(git_desc_short)
|
||||
string(SUBSTRING ${git_desc} 1 16 git_desc_short)
|
||||
configure_file(${CMAKE_SOURCE_DIR}/cmake/templates/build_git_version.h.in ${HEADER} @ONLY)
|
||||
|
||||
@@ -202,28 +202,22 @@ function(px4_nuttx_add_export)
|
||||
add_dependencies(nuttx_patch nuttx_patch_${patch_name})
|
||||
endforeach()
|
||||
|
||||
# copy
|
||||
add_custom_command(OUTPUT nuttx_copy_${CONFIG}.stamp
|
||||
COMMAND ${MKDIR} -p ${CMAKE_BINARY_DIR}/${CONFIG}
|
||||
# copy and export
|
||||
file(GLOB_RECURSE config_files ${CMAKE_SOURCE_DIR}/nuttx-configs/${CONFIG}/*)
|
||||
add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/${CONFIG}.export
|
||||
COMMAND ${MKDIR} -p ${nuttx_src}
|
||||
COMMAND ${CP} -a ${CMAKE_SOURCE_DIR}/NuttX/. ${nuttx_src}/
|
||||
COMMAND ${RM} -rf ${nuttx_src}/.git
|
||||
COMMAND ${TOUCH} nuttx_copy_${CONFIG}.stamp
|
||||
DEPENDS ${DEPENDS})
|
||||
add_custom_target(__nuttx_copy_${CONFIG}
|
||||
DEPENDS nuttx_copy_${CONFIG}.stamp __nuttx_patch_${CONFIG})
|
||||
|
||||
# export
|
||||
file(GLOB_RECURSE config_files ${CMAKE_SOURCE_DIR}/nuttx-configs/${CONFIG}/*)
|
||||
add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/${CONFIG}.export
|
||||
COMMAND ${ECHO} Configuring NuttX for ${CONFIG}
|
||||
#COMMAND ${ECHO} Configuring NuttX for ${CONFIG}
|
||||
COMMAND ${MAKE} --no-print-directory -C${nuttx_src}/nuttx -r --quiet distclean
|
||||
COMMAND ${CP} -r ${CMAKE_SOURCE_DIR}/nuttx-configs/PX4_Warnings.mk ${nuttx_src}/nuttx/
|
||||
COMMAND ${CP} -r ${CMAKE_SOURCE_DIR}/nuttx-configs/${CONFIG} ${nuttx_src}/nuttx/configs
|
||||
COMMAND cd ${nuttx_src}/nuttx/tools && ./configure.sh ${CONFIG}/nsh
|
||||
COMMAND ${ECHO} Exporting NuttX for ${CONFIG}
|
||||
COMMAND ${MAKE} --no-print-directory --quiet -C ${nuttx_src}/nuttx -j${THREADS} -r CONFIG_ARCH_BOARD=${CONFIG} export > /dev/null
|
||||
#COMMAND ${ECHO} Exporting NuttX for ${CONFIG}
|
||||
COMMAND ${MAKE} --no-print-directory --quiet -C ${nuttx_src}/nuttx -j${THREADS} -r CONFIG_ARCH_BOARD=${CONFIG} export > nuttx_build.log
|
||||
COMMAND ${CP} -r ${nuttx_src}/nuttx/nuttx-export.zip ${CMAKE_BINARY_DIR}/${CONFIG}.export
|
||||
DEPENDS ${config_files} ${DEPENDS} __nuttx_copy_${CONFIG})
|
||||
DEPENDS ${config_files} ${DEPENDS}
|
||||
COMMENT "Building NuttX for ${CONFIG}")
|
||||
|
||||
# extract
|
||||
add_custom_command(OUTPUT nuttx_export_${CONFIG}.stamp
|
||||
|
||||
Reference in New Issue
Block a user