Skip to content

Commit

Permalink
add job_refresh
Browse files Browse the repository at this point in the history
  • Loading branch information
simbit18 committed Sep 27, 2024
1 parent a823370 commit 5324ea0
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 9 deletions.
26 changes: 19 additions & 7 deletions cmake/menuconfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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=$<IF:$<BOOL:${LINUX}>,y,n>"
"HOST_MACOS=$<IF:$<BOOL:${APPLE}>,y,n>"
"HOST_WINDOWS=$<IF:$<BOOL:${WIN32}>,y,n>"
"HOST_OTHER=$<IF:$<BOOL:${OTHER_OS}>,y,n>")
"BINDIR=${CMAKE_BINARY_DIR}")

# Use qconfig instead of menuconfig since PowerShell not support curses
# redirection
Expand Down Expand Up @@ -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
Expand All @@ -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})
4 changes: 2 additions & 2 deletions tools/testbuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 5324ea0

Please sign in to comment.