fix(cmake): Rebuild on changes in sdkconfig.defaults

When you change sdkconfig.defaults, sdkconfig is not updated and a rebuild is
not triggered. This commit fixes that by adding the files to the target.
This commit is contained in:
Mathy Vanvoorden 2024-07-16 22:09:10 +02:00
parent 5ca9f2a49a
commit 3ecbb4d170
No known key found for this signature in database
GPG Key ID: 3E4C4D02B4C6C75A

View File

@ -215,6 +215,17 @@ function(__kconfig_generate_config sdkconfig sdkconfig_defaults)
# When sdkconfig file changes in the future, trigger a cmake run
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${sdkconfig}")
# Or if any of the sdkconfig.defaults files change
if(sdkconfig_defaults)
foreach(sdkconfig_default ${sdkconfig_defaults})
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${sdkconfig_default}")
if(EXISTS "${sdkconfig_default}.${idf_target}")
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${sdkconfig_default}.${idf_target}")
endif()
endforeach()
endif()
# Ditto if either of the generated files are missing/modified (this is a bit irritating as it means
# you can't edit these manually without them being regenerated, but I don't know of a better way...)
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${sdkconfig_header}")