Merge branch 'feature/arch_build_property' into 'master'

build-system: add property for architecture (riscv/xtensa)

Closes IDF-1754

See merge request espressif/esp-idf!18127
This commit is contained in:
Marius Vikhammer 2022-05-24 08:46:09 +08:00
commit d485f6add8
10 changed files with 23 additions and 11 deletions

View File

@ -9,5 +9,5 @@ if(NOT BOOTLOADER_BUILD)
set(legacy_reqs soc)
endif()
idf_component_register(REQUIRES xtensa "${legacy_reqs}"
idf_component_register(REQUIRES "${legacy_reqs}"
REQUIRED_IDF_TARGETS esp32)

View File

@ -9,5 +9,5 @@ if(NOT BOOTLOADER_BUILD)
set(legacy_reqs soc)
endif()
idf_component_register(REQUIRES riscv "${legacy_reqs}"
idf_component_register(REQUIRES "${legacy_reqs}"
REQUIRED_IDF_TARGETS esp32c2)

View File

@ -9,5 +9,5 @@ if(NOT BOOTLOADER_BUILD)
set(legacy_reqs soc)
endif()
idf_component_register(REQUIRES riscv "${legacy_reqs}"
idf_component_register(REQUIRES "${legacy_reqs}"
REQUIRED_IDF_TARGETS esp32c3)

View File

@ -9,5 +9,5 @@ if(NOT BOOTLOADER_BUILD)
set(legacy_reqs soc)
endif()
idf_component_register(REQUIRES riscv "${legacy_reqs}"
idf_component_register(REQUIRES "${legacy_reqs}"
REQUIRED_IDF_TARGETS esp32h2)

View File

@ -9,5 +9,5 @@ if(NOT BOOTLOADER_BUILD)
set(legacy_reqs soc)
endif()
idf_component_register(REQUIRES xtensa "${legacy_reqs}"
idf_component_register(REQUIRES "${legacy_reqs}"
REQUIRED_IDF_TARGETS esp32s2)

View File

@ -9,5 +9,5 @@ if(NOT BOOTLOADER_BUILD)
set(legacy_reqs soc)
endif()
idf_component_register(REQUIRES xtensa "${legacy_reqs}"
idf_component_register(REQUIRES "${legacy_reqs}"
REQUIRED_IDF_TARGETS esp32s3)

View File

@ -1,10 +1,11 @@
idf_build_get_property(target IDF_TARGET)
idf_build_get_property(arch IDF_TARGET_ARCH)
# should test arch here not target: IDF-1754
if(NOT "${target}" STREQUAL "esp32c3" AND NOT "${target}" STREQUAL "esp32h2" AND NOT "${target}" STREQUAL "esp32c2")
if(NOT "${arch}" STREQUAL "riscv")
return()
endif()
if(BOOTLOADER_BUILD)
set(priv_requires soc)
else()

View File

@ -1,7 +1,7 @@
idf_build_get_property(target IDF_TARGET)
idf_build_get_property(arch IDF_TARGET_ARCH)
# should test arch here not target: IDF-1754
if("${target}" STREQUAL "esp32c3" OR "${target}" STREQUAL "esp32h2" OR "${target}" STREQUAL "esp32c2")
if(NOT "${arch}" STREQUAL "xtensa")
return()
endif()

View File

@ -548,7 +548,7 @@ Common component requirements
To avoid duplication, every component automatically requires some "common" IDF components even if they are not mentioned explicitly. Headers from these components can always be included.
The list of common components is: cxx, newlib, freertos, esp_hw_support, heap, log, soc, hal, esp_rom, esp_common, esp_system.
The list of common components is: cxx, newlib, freertos, esp_hw_support, heap, log, soc, hal, esp_rom, esp_common, esp_system, xtensa/riscv.
Including components in the build
----------------------------------

View File

@ -401,6 +401,15 @@ macro(idf_build_process target)
idf_build_set_property(IDF_TARGET ${target})
if("${target}" STREQUAL "esp32" OR "${target}" STREQUAL "esp32s2" OR "${target}" STREQUAL "esp32s3")
idf_build_set_property(IDF_TARGET_ARCH "xtensa")
elseif("${target}" STREQUAL "linux")
# No arch specified for linux host builds at the moment
idf_build_set_property(IDF_TARGET_ARCH "")
else()
idf_build_set_property(IDF_TARGET_ARCH "riscv")
endif()
__build_set_default(PROJECT_DIR ${CMAKE_SOURCE_DIR})
__build_set_default(PROJECT_NAME ${CMAKE_PROJECT_NAME})
__build_set_default(PROJECT_VER 1)
@ -415,9 +424,11 @@ macro(idf_build_process target)
__build_check_python()
idf_build_get_property(target IDF_TARGET)
idf_build_get_property(arch IDF_TARGET_ARCH)
if(NOT "${target}" STREQUAL "linux")
idf_build_set_property(__COMPONENT_REQUIRES_COMMON ${target} APPEND)
idf_build_set_property(__COMPONENT_REQUIRES_COMMON ${arch} APPEND)
endif()
# Call for component manager to download dependencies for all components