feat(cmakev2/idf): add IDF_BUILD_VER_TAG identifier

Add the IDF_BUILD_VER_TAG variables to include the build system version
tag. These variables can be used in files, such as CMake toolchain
files, which are shared between cmakev1 and cmakev2. This allows for the
inclusion of files from the currently running build system version. For
example:
include($ENV{IDF_PATH}/tools/cmake${IDF_BUILD_VER_TAG}/utilities.cmake).

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
This commit is contained in:
Frantisek Hrbata
2025-08-19 09:44:25 +02:00
parent a83ac273a6
commit 71f5ee5bf6

View File

@@ -31,16 +31,19 @@ include(ExternalProject)
#[[
__init_build_version()
Set the global variables IDF_BUILD_V2 and IDF_BUILD_VER, as well as the
build properties and environmental variables.
Set the global variables IDF_BUILD_V2, IDF_BUILD_VER and IDF_BUILD_VER_TAG,
as well as the build properties and environmental variables.
#]]
function(__init_build_version)
set(IDF_BUILD_V2 y PARENT_SCOPE)
set(IDF_BUILD_VER 2 PARENT_SCOPE)
set(IDF_BUILD_VER_TAG "v2" PARENT_SCOPE)
idf_build_set_property(IDF_BUILD_V2 y)
idf_build_set_property(IDF_BUILD_VER 2)
idf_build_set_property(IDF_BUILD_VER_TAG "v2")
set(ENV{IDF_BUILD_V2} y)
set(ENV{IDF_BUILD_VER} 2)
set(ENV{IDF_BUILD_VER_TAG} "v2")
endfunction()
#[[