This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new f7c65c6205b cmake: reconfigure when .config changes
f7c65c6205b is described below

commit f7c65c6205b159b1b4ef1d82e33e841bd27281cf
Author: Zhaoqi Xu <[email protected]>
AuthorDate: Tue Sep 8 08:39:55 2026 +0800

    cmake: reconfigure when .config changes
    
    config.h and CONFIG_* are produced at configure time. kconfig-tweak
    edits .config without going through the menuconfig target, so Ninja
    left a stale header. Watch .config with CMAKE_CONFIGURE_DEPENDS.
    
    Fixes apache/nuttx#12322
    
    Signed-off-by: Zhaoqi Xu <[email protected]>
---
 CMakeLists.txt | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index d058637a92b..16f2720b991 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -413,6 +413,15 @@ if(NOT EXISTS ${NUTTX_BINARY_DIR}/.config OR NOT 
"${NUTTX_DEFCONFIG}" STREQUAL
   message(STATUS "  Appdir: ${NUTTX_APPS_DIR}")
 endif()
 
+# config.h and CONFIG_* are generated at configure time. Watch .config so an
+# out-of-band edit (kconfig-tweak) reruns CMake instead of leaving a stale
+# header. .config is only rewritten when missing or the defconfig path changes,
+# so this does not loop.
+set_property(
+  DIRECTORY
+  APPEND
+  PROPERTY CMAKE_CONFIGURE_DEPENDS ${NUTTX_BINARY_DIR}/.config)
+
 # declare global custom targets at very beginning `nuttx_global` is used to 
hold
 # global target properties to solve that cmake GLOBAL property can not use
 # generator expression this is needed to make sure added before project() 
create

Reply via email to