mirror of
https://github.com/espressif/esp-idf.git
synced 2026-04-27 19:13:21 +00:00
feat(cmakev2/idf): initialize IDF_TARGET_ARCH build property
Based on the configuration, set the IDF_TARGET build property. This is also set by cmakev1 and can be used to easily determine the architecture for the project. Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
This commit is contained in:
@@ -458,6 +458,24 @@ function(__init_submodules)
|
||||
endforeach()
|
||||
endfunction()
|
||||
|
||||
#[[
|
||||
__init_idf_target_arch()
|
||||
|
||||
Set the IDF_TARGET_ARCH value based on the sdkconfig. This means it must be
|
||||
initialized after the sdkconfig is generated and its CMake version is
|
||||
included.
|
||||
#]]
|
||||
function(__init_idf_target_arch)
|
||||
if(CONFIG_IDF_TARGET_ARCH_XTENSA)
|
||||
idf_build_set_property(IDF_TARGET_ARCH "xtensa")
|
||||
elseif(CONFIG_IDF_TARGET_ARCH_RISCV)
|
||||
idf_build_set_property(IDF_TARGET_ARCH "riscv")
|
||||
else()
|
||||
# Currently, no architecture is specified for Linux host builds.
|
||||
idf_build_set_property(IDF_TARGET_ARCH "")
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
#[[
|
||||
The idf_build_properties interface target is exclusively used to store
|
||||
information about global build properties and is not linked or used in any
|
||||
@@ -556,6 +574,10 @@ if(NOT EXISTS "${sdkconfig_cmake}")
|
||||
endif()
|
||||
include("${sdkconfig_cmake}")
|
||||
|
||||
# Initialize the target architecture based on the configuration. Ensure this is
|
||||
# done after including the sdkconfig.
|
||||
__init_idf_target_arch()
|
||||
|
||||
#[[ TODO
|
||||
|
||||
Many of the following things are already implemented in PoC !38337, but they
|
||||
|
||||
Reference in New Issue
Block a user