diff --git a/cmake/menuconfig.cmake b/cmake/menuconfig.cmake index ff00e8aaedcd8..fca8ac53b806a 100644 --- a/cmake/menuconfig.cmake +++ b/cmake/menuconfig.cmake @@ -29,11 +29,7 @@ set(KCONFIG_ENV "APPSDIR=${NUTTX_APPS_DIR}" "DRIVERS_PLATFORM_DIR=dummy" "APPSBINDIR=${NUTTX_APPS_BINDIR}" - "BINDIR=${CMAKE_BINARY_DIR}" - "HOST_LINUX=$,y,n>" - "HOST_MACOS=$,y,n>" - "HOST_WINDOWS=$,y,n>" - "HOST_OTHER=$,y,n>") + "BINDIR=${CMAKE_BINARY_DIR}") # Use qconfig instead of menuconfig since PowerShell not support curses # redirection @@ -72,8 +68,8 @@ add_custom_target( ${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} + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_BINARY_DIR}/defconfig + ${NUTTX_DEFCONFIG} WORKING_DIRECTORY ${NUTTX_DIR}) # utility target to restore .config from board's defconfig @@ -86,3 +82,19 @@ add_custom_target( ${CMAKE_BINARY_DIR}/.config.orig COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_PARENT_LIST_FILE} WORKING_DIRECTORY ${NUTTX_DIR}) + +# refresh .config from board's defconfig +add_custom_target( + job_refresh + COMMAND ${CMAKE_COMMAND} -E remove -f + ${CMAKE_BINARY_DIR}/SAVEconfig + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/.config + ${CMAKE_BINARY_DIR}/SAVEconfig + COMMAND ${CMAKE_COMMAND} -E remove -f + ${CMAKE_BINARY_DIR}/.config + COMMAND ${CMAKE_COMMAND} -E copy ${NUTTX_DEFCONFIG} + ${CMAKE_BINARY_DIR}/.config + COMMAND ${CMAKE_COMMAND} -E env ${CMAKE_BINARY_DIR}/.config olddefconfig + COMMAND ${CMAKE_COMMAND} -E env ${KCONFIG_ENV} savedefconfig + 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 deb260c43a3ba..8210e9e8dffc2 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 job_refresh 1>/dev/null; then + cmake --build build -t job_refresh fail=1 fi