Просмотр исходного кода

Merge branch 'feature/remove_target_cmake' into 'master'

build-system: remove target component

Closes IDF-3091 and IDF-3581

See merge request espressif/esp-idf!18131
Zim Kalinowski 3 лет назад
Родитель
Сommit
2c9cd8e307

+ 0 - 1
.gitlab/CODEOWNERS

@@ -78,7 +78,6 @@
 /components/cxx/                      @esp-idf-codeowners/system
 /components/driver/                   @esp-idf-codeowners/peripherals
 /components/efuse/                    @esp-idf-codeowners/system
-/components/esp32*/                   @esp-idf-codeowners/system
 /components/esp_adc_cal/              @esp-idf-codeowners/peripherals
 /components/esp_common/               @esp-idf-codeowners/system
 /components/esp_eth/                  @esp-idf-codeowners/network

+ 0 - 13
components/esp32/CMakeLists.txt

@@ -1,13 +0,0 @@
-idf_build_get_property(target IDF_TARGET)
-if(NOT "${target}" STREQUAL "esp32")
-    return()
-endif()
-
-if(NOT BOOTLOADER_BUILD)
-    # [refactor-todo] propagate these requirements for compatibility
-    # remove in the future
-    set(legacy_reqs soc)
-endif()
-
-idf_component_register(REQUIRES "${legacy_reqs}"
-                       REQUIRED_IDF_TARGETS esp32)

+ 0 - 13
components/esp32c2/CMakeLists.txt

@@ -1,13 +0,0 @@
-idf_build_get_property(target IDF_TARGET)
-if(NOT "${target}" STREQUAL "esp32c2")
-    return()
-endif()
-
-if(NOT BOOTLOADER_BUILD)
-    # [refactor-todo] propagate these requirements for compatibility
-    # remove in the future
-    set(legacy_reqs soc)
-endif()
-
-idf_component_register(REQUIRES "${legacy_reqs}"
-                       REQUIRED_IDF_TARGETS esp32c2)

+ 0 - 13
components/esp32c3/CMakeLists.txt

@@ -1,13 +0,0 @@
-idf_build_get_property(target IDF_TARGET)
-if(NOT "${target}" STREQUAL "esp32c3")
-    return()
-endif()
-
-if(NOT BOOTLOADER_BUILD)
-    # [refactor-todo] propagate these requirements for compatibility
-    # remove in the future
-    set(legacy_reqs soc)
-endif()
-
-idf_component_register(REQUIRES "${legacy_reqs}"
-                       REQUIRED_IDF_TARGETS esp32c3)

+ 0 - 5
components/esp32c3/project_include.cmake

@@ -1,5 +0,0 @@
-set(compile_options "-Wno-error=format="
-                    "-nostartfiles"
-                    "-Wno-format")
-
-idf_build_set_property(COMPILE_OPTIONS "${compile_options}" APPEND)

+ 0 - 13
components/esp32h2/CMakeLists.txt

@@ -1,13 +0,0 @@
-idf_build_get_property(target IDF_TARGET)
-if(NOT "${target}" STREQUAL "esp32h2")
-    return()
-endif()
-
-if(NOT BOOTLOADER_BUILD)
-    # [refactor-todo] propagate these requirements for compatibility
-    # remove in the future
-    set(legacy_reqs soc)
-endif()
-
-idf_component_register(REQUIRES "${legacy_reqs}"
-                       REQUIRED_IDF_TARGETS esp32h2)

+ 0 - 5
components/esp32h2/project_include.cmake

@@ -1,5 +0,0 @@
-set(compile_options "-Wno-error=format="
-                    "-nostartfiles"
-                    "-Wno-format")
-
-idf_build_set_property(COMPILE_OPTIONS "${compile_options}" APPEND)

+ 0 - 13
components/esp32s2/CMakeLists.txt

@@ -1,13 +0,0 @@
-idf_build_get_property(target IDF_TARGET)
-if(NOT "${target}" STREQUAL "esp32s2")
-    return()
-endif()
-
-if(NOT BOOTLOADER_BUILD)
-    # [refactor-todo] propagate these requirements for compatibility
-    # remove in the future
-    set(legacy_reqs soc)
-endif()
-
-idf_component_register(REQUIRES "${legacy_reqs}"
-                       REQUIRED_IDF_TARGETS esp32s2)

+ 0 - 13
components/esp32s3/CMakeLists.txt

@@ -1,13 +0,0 @@
-idf_build_get_property(target IDF_TARGET)
-if(NOT "${target}" STREQUAL "esp32s3")
-    return()
-endif()
-
-if(NOT BOOTLOADER_BUILD)
-    # [refactor-todo] propagate these requirements for compatibility
-    # remove in the future
-    set(legacy_reqs soc)
-endif()
-
-idf_component_register(REQUIRES "${legacy_reqs}"
-                       REQUIRED_IDF_TARGETS esp32s3)

+ 0 - 1
components/esp_common/CMakeLists.txt

@@ -11,7 +11,6 @@ list(APPEND srcs "src/esp_err_to_name.c")
 # Note: esp_ipc, esp_pm added as a public requirement to keep compatibility as to be located here.
 idf_component_register(SRCS "${srcs}"
                         INCLUDE_DIRS include
-                        REQUIRES ${target}
                         LDFRAGMENTS "common.lf" "soc.lf")
 
 set_property(TARGET ${COMPONENT_LIB} APPEND PROPERTY LINK_INTERFACE_MULTIPLICITY 4)

+ 1 - 1
components/esp_timer/CMakeLists.txt

@@ -14,4 +14,4 @@ idf_component_register(SRCS "${srcs}"
                     INCLUDE_DIRS include
                     PRIV_INCLUDE_DIRS private_include
                     REQUIRES esp_common
-                    PRIV_REQUIRES soc driver "${target}")
+                    PRIV_REQUIRES soc driver)

+ 0 - 1
components/hal/CMakeLists.txt

@@ -173,7 +173,6 @@ idf_component_register(SRCS ${srcs}
                        INCLUDE_DIRS ${includes}
                        PRIV_INCLUDE_DIRS ${priv_include}
                        REQUIRES soc esp_rom
-                       PRIV_REQUIRES ${target}
                        LDFRAGMENTS linker.lf)
 
 if(CONFIG_HAL_DEFAULT_ASSERTION_LEVEL EQUAL 1)

+ 2 - 6
components/mbedtls/CMakeLists.txt

@@ -252,18 +252,14 @@ if(CONFIG_MBEDTLS_DYNAMIC_BUFFER)
 endif()
 
 set_property(TARGET mbedcrypto APPEND PROPERTY LINK_INTERFACE_LIBRARIES mbedtls)
-set_property(TARGET mbedcrypto APPEND PROPERTY LINK_LIBRARIES idf::driver idf::${target})
-set_property(TARGET mbedcrypto APPEND PROPERTY INTERFACE_LINK_LIBRARIES idf::driver idf::${target})
+set_property(TARGET mbedcrypto APPEND PROPERTY LINK_LIBRARIES idf::driver)
+set_property(TARGET mbedcrypto APPEND PROPERTY INTERFACE_LINK_LIBRARIES idf::driver)
 
 target_link_libraries(${COMPONENT_LIB} ${linkage_type} ${mbedtls_targets})
 
 if(CONFIG_ESP_TLS_USE_DS_PERIPHERAL)
-    # Link target (e.g. esp32s2) library to component library
-    idf_component_get_property(target_lib ${target} COMPONENT_LIB)
-    set_property(TARGET mbedcrypto APPEND PROPERTY INTERFACE_LINK_LIBRARIES $<LINK_ONLY:${target_lib}>)
     # The linker seems to be unable to resolve all the dependencies without increasing this
     set_property(TARGET mbedcrypto APPEND PROPERTY LINK_INTERFACE_MULTIPLICITY 6)
-    target_link_libraries(${COMPONENT_LIB} ${linkage_type} ${target_lib})
 endif()
 
 # Link esp-cryptoauthlib to mbedtls

+ 0 - 0
components/esp32c2/project_include.cmake → components/riscv/project_include.cmake


+ 15 - 0
docs/en/migration-guides/removed-components.rst

@@ -1,6 +1,9 @@
 Removed or deprecated components
 ================================
 
+Components moved to IDF Component Registry
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
 Following components are removed from ESP-IDF and moved to `IDF Component Registry <https://components.espressif.com/>`_:
 
 * `libsodium <https://components.espressif.com/component/espressif/libsodium>`_
@@ -25,8 +28,20 @@ To install libsodium component with the latest version compatible to X.Y accordi
 
 To find out which versions of each component are available, open https://components.espressif.com, search for the component by its name and check the versions listed on the component page.
 
+Deprecated Components
+^^^^^^^^^^^^^^^^^^^^^
+
 Following components are removed since they were deprecated in IDF v4.x
 
 * ``tcpip_adapter`` Please use the :doc:`ESP-NETIF </api-reference/network/esp_netif>` component instead; you can follow the `Migration guide to ESP-NETIF<tcpip-adapter>`
 
 .. note:: OpenSSL-API component is no longer supported. It is not available in the IDF Component Registry, either. Please use :doc:`ESP-TLS </api-reference/protocols/esp_tls>` or :component:`mbedtls` API directly.
+
+The targets components are no longer necessary after refactoring and have been removed:
+
+ * ``esp32``
+ * ``esp32s2``
+ * ``esp32s3``
+ * ``esp32c2``
+ * ``esp32c3``
+ * ``esp32h2``

+ 2 - 2
examples/build_system/cmake/idf_as_lib/CMakeLists.txt

@@ -15,7 +15,7 @@ if("${TARGET}" IN_LIST targets)
                     # although esptool_py does not generate static library,
                     # processing the component is needed for flashing related
                     # targets and file generation
-                    COMPONENTS "${TARGET}" freertos esptool_py
+                    COMPONENTS freertos esptool_py
                     SDKCONFIG ${CMAKE_CURRENT_LIST_DIR}/sdkconfig
                     BUILD_DIR ${CMAKE_BINARY_DIR})
 else()
@@ -33,7 +33,7 @@ add_executable(${elf_file} main.c)
 
 # Link the static libraries to the executable
 if("${TARGET}" IN_LIST targets)
-    target_link_libraries(${elf_file} "idf::${TARGET}" idf::freertos idf::spi_flash)
+    target_link_libraries(${elf_file} idf::freertos idf::spi_flash)
     # Attach additional targets to the executable file for flashing,
     # linker script generation, partition_table generation, etc.
     idf_build_executable(${elf_file})

+ 0 - 1
tools/cmake/build.cmake

@@ -427,7 +427,6 @@ macro(idf_build_process 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()
 

+ 0 - 1
tools/test_apps/system/g1_components/CMakeLists.txt

@@ -16,7 +16,6 @@ project(g1_components)
 
 set(extra_allowed_components
     ${CONFIG_IDF_TARGET_ARCH}
-    ${CONFIG_IDF_TARGET}
 )
 
 # These components are currently included into "G1" build, but shouldn't.