diff --git a/config/esp32/components/chip/CMakeLists.txt b/config/esp32/components/chip/CMakeLists.txt index e085a044ba2e01..455732465136c7 100644 --- a/config/esp32/components/chip/CMakeLists.txt +++ b/config/esp32/components/chip/CMakeLists.txt @@ -234,3 +234,8 @@ target_link_libraries(${COMPONENT_LIB} INTERFACE -Wl,--start-group # Make the component dependent on our CHIP build add_dependencies(${COMPONENT_LIB} chip_gn) + +if(CONFIG_ENABLE_PW_RPC) + set(WRAP_FUNCTIONS esp_log_write) + target_link_libraries(${COMPONENT_LIB} INTERFACE "-Wl,--wrap=${WRAP_FUNCTIONS}") +endif() diff --git a/examples/all-clusters-app/esp32/main/CMakeLists.txt b/examples/all-clusters-app/esp32/main/CMakeLists.txt index 6554df86908ddd..0b4520dca3d90d 100644 --- a/examples/all-clusters-app/esp32/main/CMakeLists.txt +++ b/examples/all-clusters-app/esp32/main/CMakeLists.txt @@ -119,11 +119,6 @@ target_compile_options(${COMPONENT_LIB} PRIVATE "-DLWIP_IPV6_SCOPES=0" "-DCHIP_H if (CONFIG_ENABLE_PW_RPC) -idf_component_get_property(chip_lib chip COMPONENT_LIB) - -set(WRAP_FUNCTIONS esp_log_write) -target_link_libraries(${chip_lib} INTERFACE "-Wl,--wrap=${WRAP_FUNCTIONS}") - get_filename_component(CHIP_ROOT ../third_party/connectedhomeip REALPATH) set(PIGWEED_ROOT "${CHIP_ROOT}/third_party/pigweed/repo") @@ -225,10 +220,4 @@ target_link_options(${COMPONENT_LIB} "-T${PIGWEED_ROOT}/pw_tokenizer/pw_tokenizer_linker_sections.ld" ) -set_property(TARGET ${chip_lib} APPEND PROPERTY LINK_LIBRARIES ${COMPONENT_LIB}) -target_include_directories(${chip_lib} PUBLIC - "$/protocol_buffer/gen/third_party/connectedhomeip/third_party/pigweed/repo/pw_rpc/protos.proto_library/nanopb_rpc" - "$/protocol_buffer/gen/third_party/connectedhomeip/third_party/pigweed/repo/pw_rpc/protos.proto_library/nanopb" - "$/protocol_buffer/gen/third_party/connectedhomeip/third_party/pigweed/repo/pw_rpc/protos.proto_library/pwpb") - endif (CONFIG_ENABLE_PW_RPC) diff --git a/examples/ipv6only-app/esp32/main/CMakeLists.txt b/examples/ipv6only-app/esp32/main/CMakeLists.txt index 4588bf8c55104f..e5931524e6e38b 100644 --- a/examples/ipv6only-app/esp32/main/CMakeLists.txt +++ b/examples/ipv6only-app/esp32/main/CMakeLists.txt @@ -31,13 +31,6 @@ idf_component_register(INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/../../common/pigweed/esp32" PRIV_REQUIRES bt chip) -idf_component_get_property(chip_lib chip COMPONENT_LIB) - -set(WRAP_FUNCTIONS esp_log_write) -target_link_libraries(${chip_lib} INTERFACE "-Wl,--wrap=${WRAP_FUNCTIONS}") - -set_property(TARGET ${chip_lib} APPEND PROPERTY LINK_LIBRARIES ${COMPONENT_LIB}) - get_filename_component(CHIP_ROOT ../third_party/connectedhomeip REALPATH) get_filename_component(IPV6_EXAMPLE_ROOT ../.. REALPATH) set(PIGWEED_ROOT "${CHIP_ROOT}/third_party/pigweed/repo") diff --git a/examples/lock-app/esp32/main/CMakeLists.txt b/examples/lock-app/esp32/main/CMakeLists.txt index d4454e3f9ff9c5..75b0d406fa412b 100644 --- a/examples/lock-app/esp32/main/CMakeLists.txt +++ b/examples/lock-app/esp32/main/CMakeLists.txt @@ -55,11 +55,6 @@ idf_component_register(INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/general_diagnostics_server" PRIV_REQUIRES bt chip QRCode) -idf_component_get_property(chip_lib chip COMPONENT_LIB) - -set(WRAP_FUNCTIONS esp_log_write) -target_link_libraries(${chip_lib} INTERFACE "-Wl,--wrap=${WRAP_FUNCTIONS}") - get_filename_component(CHIP_ROOT ../third_party/connectedhomeip REALPATH) set(PIGWEED_ROOT "${CHIP_ROOT}/third_party/pigweed/repo") @@ -112,12 +107,6 @@ target_link_libraries(${COMPONENT_LIB} PUBLIC pw_rpc.server ) -set_property(TARGET ${chip_lib} APPEND PROPERTY LINK_LIBRARIES ${COMPONENT_LIB}) -target_include_directories(${chip_lib} PUBLIC - "$/protocol_buffer/gen/third_party/connectedhomeip/third_party/pigweed/repo/pw_rpc/protos.proto_library/nanopb_rpc" - "$/protocol_buffer/gen/third_party/connectedhomeip/third_party/pigweed/repo/pw_rpc/protos.proto_library/nanopb" - "$/protocol_buffer/gen/third_party/connectedhomeip/third_party/pigweed/repo/pw_rpc/protos.proto_library/pwpb") - else (CONFIG_ENABLE_PW_RPC) idf_component_register(PRIV_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/zzz_generated/lock-app/" diff --git a/examples/pigweed-app/esp32/main/CMakeLists.txt b/examples/pigweed-app/esp32/main/CMakeLists.txt index 4500afea1b68d0..afa8c717346a91 100644 --- a/examples/pigweed-app/esp32/main/CMakeLists.txt +++ b/examples/pigweed-app/esp32/main/CMakeLists.txt @@ -30,8 +30,6 @@ idf_component_register(INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/../../common/pigweed/esp32" PRIV_REQUIRES bt chip) -idf_component_get_property(chip_lib chip COMPONENT_LIB) - get_filename_component(CHIP_ROOT ../third_party/connectedhomeip REALPATH) set(PIGWEED_ROOT "${CHIP_ROOT}/third_party/pigweed/repo") @@ -46,12 +44,3 @@ target_link_libraries(${COMPONENT_LIB} PUBLIC pw_rpc.nanopb.echo_service pw_rpc.server ) - -set(WRAP_FUNCTIONS esp_log_write) -target_link_libraries(${chip_lib} INTERFACE "-Wl,--wrap=${WRAP_FUNCTIONS}") - -set_property(TARGET ${chip_lib} APPEND PROPERTY LINK_LIBRARIES ${COMPONENT_LIB}) -target_include_directories(${chip_lib} PUBLIC - "$/protocol_buffer/gen/third_party/connectedhomeip/third_party/pigweed/repo/pw_rpc/protos.proto_library/nanopb_rpc" - "$/protocol_buffer/gen/third_party/connectedhomeip/third_party/pigweed/repo/pw_rpc/protos.proto_library/nanopb" - "$/protocol_buffer/gen/third_party/connectedhomeip/third_party/pigweed/repo/pw_rpc/protos.proto_library/pwpb")