From 4b58ad287f56215c757a64b6e6736727f7969bf2 Mon Sep 17 00:00:00 2001 From: Wang Qixiang <43193572+wqx6@users.noreply.github.com> Date: Wed, 1 May 2024 02:40:08 +0800 Subject: [PATCH] examples: Remove requires in main components for esp32 examples (#33213) --- .../all-clusters-app/esp32/main/CMakeLists.txt | 17 +++-------------- .../esp32/main/CMakeLists.txt | 15 ++------------- examples/bridge-app/esp32/main/CMakeLists.txt | 3 +-- examples/chef/esp32/main/CMakeLists.txt | 1 - .../esp32/main/CMakeLists.txt | 9 +-------- .../light-switch-app/esp32/main/CMakeLists.txt | 4 ++-- examples/lighting-app/esp32/main/CMakeLists.txt | 10 +--------- examples/lock-app/esp32/main/CMakeLists.txt | 4 ++-- .../ota-provider-app/esp32/main/CMakeLists.txt | 3 +-- .../ota-requestor-app/esp32/main/CMakeLists.txt | 5 +---- .../esp32/main/CMakeLists.txt | 3 +-- examples/pigweed-app/esp32/main/CMakeLists.txt | 3 +-- examples/shell/esp32/main/CMakeLists.txt | 3 +-- .../esp32/main/CMakeLists.txt | 3 --- 14 files changed, 17 insertions(+), 66 deletions(-) diff --git a/examples/all-clusters-app/esp32/main/CMakeLists.txt b/examples/all-clusters-app/esp32/main/CMakeLists.txt index 63851b1deeb611..7fd1d548609257 100644 --- a/examples/all-clusters-app/esp32/main/CMakeLists.txt +++ b/examples/all-clusters-app/esp32/main/CMakeLists.txt @@ -96,8 +96,8 @@ set(SRC_DIRS_LIST "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/time-synchronization-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/valve-configuration-and-control-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/dishwasher-alarm-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/laundry-washer-controls-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/laundry-washer-controls-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/laundry-washer-controls-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/laundry-washer-controls-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/laundry-dryer-controls-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/all-clusters-app/all-clusters-common/src" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/energy-preference-server" @@ -136,20 +136,9 @@ if (CONFIG_ENABLE_ICD_SERVER) list(APPEND SRC_DIRS_LIST "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32/icd") endif() -set(PRIV_REQUIRES_LIST chip QRCode bt app_update nvs_flash spi_flash openthread) - -if(${IDF_TARGET} STREQUAL "esp32") - list(APPEND PRIV_REQUIRES_LIST spidriver screen-framework) -endif() - -if(CONFIG_DEVICE_TYPE_ESP32_C3_DEVKITM) - list(APPEND PRIV_REQUIRES_LIST led_strip) -endif() - idf_component_register(PRIV_INCLUDE_DIRS ${PRIV_INCLUDE_DIRS_LIST} SRC_DIRS ${SRC_DIRS_LIST} - EXCLUDE_SRCS ${EXCLUDE_SRCS} - PRIV_REQUIRES ${PRIV_REQUIRES_LIST}) + EXCLUDE_SRCS ${EXCLUDE_SRCS}) get_filename_component(CHIP_ROOT ${CMAKE_SOURCE_DIR}/third_party/connectedhomeip REALPATH) diff --git a/examples/all-clusters-minimal-app/esp32/main/CMakeLists.txt b/examples/all-clusters-minimal-app/esp32/main/CMakeLists.txt index cae8b64315a232..7178945c7eb21c 100644 --- a/examples/all-clusters-minimal-app/esp32/main/CMakeLists.txt +++ b/examples/all-clusters-minimal-app/esp32/main/CMakeLists.txt @@ -82,7 +82,7 @@ set(SRC_DIRS_LIST "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/door-lock-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/occupancy-sensor-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/device-energy-management-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/energy-evse-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/energy-evse-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/ethernet-network-diagnostics-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/localization-configuration-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/time-format-localization-server" @@ -118,19 +118,8 @@ set(SRC_DIRS_LIST "${SRC_DIRS_LIST}" ) endif (CONFIG_ENABLE_PW_RPC) -set(PRIV_REQUIRES_LIST chip QRCode bt driver app_update nvs_flash spi_flash openthread) - -if(${IDF_TARGET} STREQUAL "esp32") - list(APPEND PRIV_REQUIRES_LIST spidriver screen-framework) -endif() - -if(CONFIG_DEVICE_TYPE_ESP32_C3_DEVKITM) - list(APPEND PRIV_REQUIRES_LIST led_strip) -endif() - idf_component_register(PRIV_INCLUDE_DIRS ${PRIV_INCLUDE_DIRS_LIST} - SRC_DIRS ${SRC_DIRS_LIST} - PRIV_REQUIRES ${PRIV_REQUIRES_LIST}) + SRC_DIRS ${SRC_DIRS_LIST}) get_filename_component(CHIP_ROOT ${CMAKE_SOURCE_DIR}/third_party/connectedhomeip REALPATH) diff --git a/examples/bridge-app/esp32/main/CMakeLists.txt b/examples/bridge-app/esp32/main/CMakeLists.txt index e2250f001799b5..3330f6971b68cd 100644 --- a/examples/bridge-app/esp32/main/CMakeLists.txt +++ b/examples/bridge-app/esp32/main/CMakeLists.txt @@ -48,8 +48,7 @@ idf_component_register(PRIV_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/operational-credentials-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/general-commissioning-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32/common" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/providers" - PRIV_REQUIRES chip QRCode bt nvs_flash) + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/providers") get_filename_component(CHIP_ROOT ${CMAKE_SOURCE_DIR}/third_party/connectedhomeip REALPATH) diff --git a/examples/chef/esp32/main/CMakeLists.txt b/examples/chef/esp32/main/CMakeLists.txt index 549f98abcfac9c..ac436a7919637b 100644 --- a/examples/chef/esp32/main/CMakeLists.txt +++ b/examples/chef/esp32/main/CMakeLists.txt @@ -118,7 +118,6 @@ endif (CONFIG_ENABLE_PW_RPC) idf_component_register(PRIV_INCLUDE_DIRS "${CHIP_SHELL_DIR}/shell_common/include" "${PRIV_INCLUDE_DIRS_LIST}" - PRIV_REQUIRES chip nvs_flash bt console mbedtls QRCode tft screen-framework spidriver SRC_DIRS ${SRC_DIRS_LIST}) # Forces the linker to include common/stubs.cpp diff --git a/examples/energy-management-app/esp32/main/CMakeLists.txt b/examples/energy-management-app/esp32/main/CMakeLists.txt index a38ce499bc1ea5..a9a8c4100ae2de 100644 --- a/examples/energy-management-app/esp32/main/CMakeLists.txt +++ b/examples/energy-management-app/esp32/main/CMakeLists.txt @@ -72,12 +72,6 @@ set(SRC_DIRS_LIST "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/electrical-power-measurement-server" ) -set(PRIV_REQUIRES_LIST chip QRCode bt led_strip app_update openthread driver nvs_flash spi_flash) - -if(${IDF_TARGET} STREQUAL "esp32") - list(APPEND PRIV_REQUIRES_LIST spidriver screen-framework) -endif() - if (CONFIG_ENABLE_PW_RPC) # Append additional directories for RPC build @@ -103,8 +97,7 @@ set(SRC_DIRS_LIST "${SRC_DIRS_LIST}" endif (CONFIG_ENABLE_PW_RPC) idf_component_register(PRIV_INCLUDE_DIRS ${PRIV_INCLUDE_DIRS_LIST} - SRC_DIRS ${SRC_DIRS_LIST} - PRIV_REQUIRES ${PRIV_REQUIRES_LIST}) + SRC_DIRS ${SRC_DIRS_LIST}) get_filename_component(CHIP_ROOT ${CMAKE_SOURCE_DIR}/third_party/connectedhomeip REALPATH) include("${CHIP_ROOT}/build/chip/esp32/esp32_codegen.cmake") diff --git a/examples/light-switch-app/esp32/main/CMakeLists.txt b/examples/light-switch-app/esp32/main/CMakeLists.txt index 210cbcefee9a23..e2600438b55346 100644 --- a/examples/light-switch-app/esp32/main/CMakeLists.txt +++ b/examples/light-switch-app/esp32/main/CMakeLists.txt @@ -59,8 +59,8 @@ idf_component_register(PRIV_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/groups-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/group-key-mgmt-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/time-synchronization-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/icd-management-server" - PRIV_REQUIRES chip QRCode bt app_update driver nvs_flash spi_flash) + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/icd-management-server") + get_filename_component(CHIP_ROOT ${CMAKE_SOURCE_DIR}/third_party/connectedhomeip REALPATH) include("${CHIP_ROOT}/build/chip/esp32/esp32_codegen.cmake") diff --git a/examples/lighting-app/esp32/main/CMakeLists.txt b/examples/lighting-app/esp32/main/CMakeLists.txt index a7cc4136145981..8b2a2fdce397cb 100644 --- a/examples/lighting-app/esp32/main/CMakeLists.txt +++ b/examples/lighting-app/esp32/main/CMakeLists.txt @@ -67,13 +67,6 @@ set(SRC_DIRS_LIST "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/scenes-server" ) -set(PRIV_REQUIRES_LIST chip QRCode bt led_strip app_update openthread driver nvs_flash spi_flash) - -if(${IDF_TARGET} STREQUAL "esp32") - list(APPEND PRIV_REQUIRES_LIST spidriver screen-framework) -endif() - - if (CONFIG_ENABLE_PW_RPC) # Append additional directories for RPC build set(PRIV_INCLUDE_DIRS_LIST "${PRIV_INCLUDE_DIRS_LIST}" @@ -98,8 +91,7 @@ set(SRC_DIRS_LIST "${SRC_DIRS_LIST}" endif (CONFIG_ENABLE_PW_RPC) idf_component_register(PRIV_INCLUDE_DIRS ${PRIV_INCLUDE_DIRS_LIST} - SRC_DIRS ${SRC_DIRS_LIST} - PRIV_REQUIRES ${PRIV_REQUIRES_LIST}) + SRC_DIRS ${SRC_DIRS_LIST}) get_filename_component(CHIP_ROOT ${CMAKE_SOURCE_DIR}/third_party/connectedhomeip REALPATH) include("${CHIP_ROOT}/build/chip/esp32/esp32_codegen.cmake") diff --git a/examples/lock-app/esp32/main/CMakeLists.txt b/examples/lock-app/esp32/main/CMakeLists.txt index e7266908ff3c1d..5c5f46abdd1860 100644 --- a/examples/lock-app/esp32/main/CMakeLists.txt +++ b/examples/lock-app/esp32/main/CMakeLists.txt @@ -74,8 +74,8 @@ idf_component_register(INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/door-lock-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/identify-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/groups-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/icd-management-server" - PRIV_REQUIRES bt chip QRCode nvs_flash driver) + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/icd-management-server") + add_dependencies(${COMPONENT_LIB} app-codegen) set(PIGWEED_ROOT "${CHIP_ROOT}/third_party/pigweed/repo") diff --git a/examples/ota-provider-app/esp32/main/CMakeLists.txt b/examples/ota-provider-app/esp32/main/CMakeLists.txt index a63033f017d8b2..41acd9e9316e00 100644 --- a/examples/ota-provider-app/esp32/main/CMakeLists.txt +++ b/examples/ota-provider-app/esp32/main/CMakeLists.txt @@ -53,8 +53,7 @@ idf_component_register(PRIV_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32/common" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/providers" EXCLUDE_SRCS - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/ota-provider-app/ota-provider-common/BdxOtaSender.cpp" - PRIV_REQUIRES chip QRCode bt console spiffs spi_flash nvs_flash) + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/ota-provider-app/ota-provider-common/BdxOtaSender.cpp") get_filename_component(CHIP_ROOT ${CMAKE_SOURCE_DIR}/third_party/connectedhomeip REALPATH) include("${CHIP_ROOT}/build/chip/esp32/esp32_codegen.cmake") diff --git a/examples/ota-requestor-app/esp32/main/CMakeLists.txt b/examples/ota-requestor-app/esp32/main/CMakeLists.txt index 10c61e162900f2..fbda70f2cec48f 100644 --- a/examples/ota-requestor-app/esp32/main/CMakeLists.txt +++ b/examples/ota-requestor-app/esp32/main/CMakeLists.txt @@ -62,8 +62,6 @@ set(SRC_DIRS_LIST "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/providers" ) -set(PRIV_REQUIRES_LIST chip QRCode bt console app_update nvs_flash) - if (CONFIG_ENABLE_PW_RPC) # Append additional directories for RPC build set(PRIV_INCLUDE_DIRS_LIST "${PRIV_INCLUDE_DIRS_LIST}" @@ -88,8 +86,7 @@ set(SRC_DIRS_LIST "${SRC_DIRS_LIST}" endif (CONFIG_ENABLE_PW_RPC) idf_component_register(PRIV_INCLUDE_DIRS ${PRIV_INCLUDE_DIRS_LIST} - SRC_DIRS ${SRC_DIRS_LIST} - PRIV_REQUIRES ${PRIV_REQUIRES_LIST}) + SRC_DIRS ${SRC_DIRS_LIST}) include("${CHIP_ROOT}/build/chip/esp32/esp32_codegen.cmake") chip_app_component_codegen("${CHIP_ROOT}/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter") diff --git a/examples/persistent-storage/esp32/main/CMakeLists.txt b/examples/persistent-storage/esp32/main/CMakeLists.txt index 30c85accfbe36d..e21c2eef5985b2 100644 --- a/examples/persistent-storage/esp32/main/CMakeLists.txt +++ b/examples/persistent-storage/esp32/main/CMakeLists.txt @@ -20,8 +20,7 @@ idf_component_register(PRIV_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/persistent-storage" SRC_DIRS "${CMAKE_CURRENT_LIST_DIR}" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/persistent-storage" - PRIV_REQUIRES chip nvs_flash) + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/persistent-storage") set_property(TARGET ${COMPONENT_LIB} PROPERTY CXX_STANDARD 17) target_compile_options(${COMPONENT_LIB} PRIVATE "-DCHIP_HAVE_CONFIG_H") diff --git a/examples/pigweed-app/esp32/main/CMakeLists.txt b/examples/pigweed-app/esp32/main/CMakeLists.txt index e06bb5a5296a14..7ac0373b72b612 100644 --- a/examples/pigweed-app/esp32/main/CMakeLists.txt +++ b/examples/pigweed-app/esp32/main/CMakeLists.txt @@ -33,8 +33,7 @@ idf_component_register(INCLUDE_DIRS "${CMAKE_CURRENT_LIST_DIR}" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/common/pigweed" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/common/pigweed/esp32" - PRIV_REQUIRES bt chip) + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/common/pigweed/esp32") get_filename_component(CHIP_ROOT ${CMAKE_SOURCE_DIR}/third_party/connectedhomeip REALPATH) set(PIGWEED_ROOT "${CHIP_ROOT}/third_party/pigweed/repo") diff --git a/examples/shell/esp32/main/CMakeLists.txt b/examples/shell/esp32/main/CMakeLists.txt index 5a565edb90a6d5..147b10bc7e1c88 100644 --- a/examples/shell/esp32/main/CMakeLists.txt +++ b/examples/shell/esp32/main/CMakeLists.txt @@ -22,5 +22,4 @@ set(CHIP_SHELL_DIR "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/she idf_component_register(SRCS main.cpp "${CHIP_SHELL_DIR}/shell_common/globals.cpp" PRIV_INCLUDE_DIRS - "${CHIP_SHELL_DIR}/shell_common/include" - PRIV_REQUIRES chip nvs_flash bt) + "${CHIP_SHELL_DIR}/shell_common/include") diff --git a/examples/temperature-measurement-app/esp32/main/CMakeLists.txt b/examples/temperature-measurement-app/esp32/main/CMakeLists.txt index 89fa5e9f755455..8bc94f7b97969a 100644 --- a/examples/temperature-measurement-app/esp32/main/CMakeLists.txt +++ b/examples/temperature-measurement-app/esp32/main/CMakeLists.txt @@ -55,8 +55,6 @@ set(SRC_DIRS_LIST "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/providers" ) -set(PRIV_REQUIRES_LIST chip QRCode bt nvs_flash espcoredump) - if (CONFIG_ENABLE_PW_RPC) # Append additional directories for RPC build set(PRIV_INCLUDE_DIRS_LIST "${PRIV_INCLUDE_DIRS_LIST}" @@ -82,7 +80,6 @@ endif (CONFIG_ENABLE_PW_RPC) idf_component_register(PRIV_INCLUDE_DIRS ${PRIV_INCLUDE_DIRS_LIST} SRC_DIRS ${SRC_DIRS_LIST} - PRIV_REQUIRES ${PRIV_REQUIRES_LIST} EMBED_FILES diagnostic_logs/end_user_support.log diagnostic_logs/network_diag.log) include("${CHIP_ROOT}/build/chip/esp32/esp32_codegen.cmake")