feat(cmakev2/idf): add __init_idf_version to set IDF_VER

Initialize the IDF_VER build property using the version.txt file, or use
git-describe. If neither is available, fall back to the value of the
IDF_VERSION environment variable.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
This commit is contained in:
Frantisek Hrbata
2025-11-04 07:48:12 +01:00
parent 94411ff55b
commit 30be939ba9
2 changed files with 47 additions and 6 deletions
+5 -1
View File
@@ -58,7 +58,7 @@ function(test_component_priority)
__dump_component_properties("${component_name}")
endfunction()
# Test that IDF_VERSION is set
# Test that IDF_VERSION and IDF_VER build property is set
function(test_idf_version)
if(NOT DEFINED IDF_VERSION_MAJOR OR
NOT DEFINED IDF_VERSION_MINOR OR
@@ -66,6 +66,10 @@ function(test_idf_version)
NOT DEFINED ENV{IDF_VERSION})
idf_die("IDF_VERSION not set")
endif()
idf_build_get_property(idf_ver IDF_VER)
if(NOT idf_ver)
idf_die("IDF_VER build property not set")
endif()
endfunction()
# Test that Python interpreter is set