pietroalbini commented on code in PR #13086:
URL: https://github.com/apache/nuttx/pull/13086#discussion_r1726681614


##########
cmake/menuconfig.cmake:
##########
@@ -74,6 +74,24 @@ add_custom_target(
           ${NUTTX_DEFCONFIG}
   WORKING_DIRECTORY ${NUTTX_DIR})
 
+add_custom_target(
+  oldconfig
+  COMMAND ${CMAKE_COMMAND} -E env ${KCONFIG_ENV} oldconfig
+  COMMAND ${CMAKE_COMMAND} -E remove -f
+          ${CMAKE_BINARY_DIR}/include/nuttx/config.h # invalidate existing
+                                                     # config
+  COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_PARENT_LIST_FILE}

Review Comment:
   The general reason why this command is here is the same as 
https://github.com/apache/nuttx/pull/13086#discussion_r1726678583. If the 
command above is present but this one is not, building after invoking 
`oldconfig` or `olddefconfig` will result in this error:
   
   ```
   ninja: error: 'include/nuttx/config.h', needed by 
'CMakeFiles/nuttx_context', missing and no known rule to make it
   ```
   
   I am not that familiar with CMake to know exactly why this command fixes the 
error message, but I guess it prompts CMAke to re-evaluate the list of rules it 
provides to ninja.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to