From 791d7c97d03ab3055247bf7d0f0106dd3ba6f27f Mon Sep 17 00:00:00 2001 From: simbit18 <101105604+simbit18@users.noreply.github.com> Date: Fri, 18 Oct 2024 12:27:32 +0200 Subject: [PATCH] cmake: Renamed savedefconfig with refreshsilent Renamed savedefconfig -> refreshsilent name more consistent with the refresh stage for cmake on github. Added new savedefconfig to fix https://github.com/apache/nuttx/issues/14281 --- cmake/menuconfig.cmake | 13 ++++++++++++- tools/testbuild.sh | 4 ++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/cmake/menuconfig.cmake b/cmake/menuconfig.cmake index 7dfd4a6c99..694c29845a 100644 --- a/cmake/menuconfig.cmake +++ b/cmake/menuconfig.cmake @@ -72,7 +72,7 @@ add_custom_target( # utility target to refresh .config from board's defconfig for GITHUB add_custom_target( - savedefconfig + refreshsilent COMMAND ${CMAKE_COMMAND} -E remove -f ${CMAKE_BINARY_DIR}/SAVEconfig COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/.config ${CMAKE_BINARY_DIR}/SAVEconfig @@ -87,3 +87,14 @@ add_custom_target( COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_BINARY_DIR}/defconfig ${NUTTX_DEFCONFIG} WORKING_DIRECTORY ${NUTTX_DIR}) + +# utility target to replace defconfig to board's defconfig +add_custom_target( + savedefconfig + COMMAND ${CMAKE_COMMAND} -E env ${KCONFIG_ENV} savedefconfig --out + ${CMAKE_BINARY_DIR}/defconfig.tmp + COMMAND ${CMAKE_COMMAND} -P ${NUTTX_DIR}/cmake/savedefconfig.cmake + ${CMAKE_BINARY_DIR}/.config ${CMAKE_BINARY_DIR}/defconfig.tmp + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_BINARY_DIR}/defconfig + ${NUTTX_DEFCONFIG} + WORKING_DIRECTORY ${NUTTX_DIR}) diff --git a/tools/testbuild.sh b/tools/testbuild.sh index 91820c383e..6a8306a6b5 100755 --- a/tools/testbuild.sh +++ b/tools/testbuild.sh @@ -450,8 +450,8 @@ function refresh_cmake { kconfig-tweak --file $nuttx/build/.config -d $toolchain fi - if ! cmake --build build -t savedefconfig 1>/dev/null; then - cmake --build build -t savedefconfig + if ! cmake --build build -t refreshsilent 1>/dev/null; then + cmake --build build -t refreshsilent fail=1 fi