mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-01 18:50:34 +03:00
feat(cmakev2/idf): add IDF_VERSION variables
The version.cmake file should be the sole file used from the cmakev1 build system. There's no need to maintain the IDF_VERSION information in two separate locations. Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
This commit is contained in:
@@ -9,6 +9,10 @@ cmake_minimum_required(VERSION 3.22)
|
||||
# included.
|
||||
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}" ${CMAKE_MODULE_PATH})
|
||||
|
||||
# The version.cmake file, which contains the IDF_VERSION variables, is the only
|
||||
# file included from the cmakev1 build system.
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/../cmake/version.cmake)
|
||||
|
||||
include(component)
|
||||
include(build)
|
||||
|
||||
@@ -152,7 +156,6 @@ __init_components()
|
||||
Many of the following things are already implemented in PoC !38337, but they
|
||||
need to be reviewed.
|
||||
|
||||
* Set IDF version.
|
||||
* Set and check python interpreter.
|
||||
* Set build target.
|
||||
* Set the toolchain before invoking project().
|
||||
|
||||
@@ -65,6 +65,19 @@ function(test_component_priority)
|
||||
__dump_component_properties("${component_name}")
|
||||
endfunction()
|
||||
|
||||
# Test that IDF_VERSION is set
|
||||
function(test_idf_version)
|
||||
if(NOT DEFINED IDF_VERSION_MAJOR OR
|
||||
NOT DEFINED IDF_VERSION_MINOR OR
|
||||
NOT DEFINED IDF_VERSION_PATCH OR
|
||||
NOT DEFINED ENV{IDF_VERSION})
|
||||
idf_die("IDF_VERSION not set")
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
# Run tests
|
||||
test_dump_properties()
|
||||
test_component_priority()
|
||||
test_idf_version()
|
||||
|
||||
message("ALL TESTS PASSED")
|
||||
|
||||
Reference in New Issue
Block a user