Merge branch 'fix/ai_idf_ver_fallback_when_no_git' into 'master'

fix(cmake): Fall back to version from components when git describe fails

Closes IDFGH-17245

See merge request espressif/esp-idf!45918
This commit is contained in:
Roland Dobai
2026-02-24 12:34:13 +01:00
+3 -1
View File
@@ -147,8 +147,10 @@ function(__build_get_idf_git_revision)
if(EXISTS "${idf_path}/version.txt")
file(STRINGS "${idf_path}/version.txt" idf_ver_t)
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${idf_path}/version.txt")
else()
elseif(idf_ver_git)
set(idf_ver_t ${idf_ver_git})
else()
set(idf_ver_t "v${IDF_VERSION_MAJOR}.${IDF_VERSION_MINOR}.${IDF_VERSION_PATCH}")
endif()
# cut IDF_VER to required 32 characters.
string(SUBSTRING "${idf_ver_t}" 0 31 idf_ver)