Skip to content

Commit

Permalink
chip-components: add target_link_libraries for zap-generated
Browse files Browse the repository at this point in the history
  • Loading branch information
DejinChen committed Sep 28, 2023
1 parent 1b8e8b5 commit 00d690b
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions config/esp32/components/chip/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ if(NOT "${IDF_TARGET}" STREQUAL "esp32h2")
list(APPEND CHIP_REQUIRE_COMPONENTS mdns)
endif()

set(SRC_DIRS_LIST "."
"${MATTER_SDK_PATH}/src/access"
set(SRC_DIRS_LIST "${MATTER_SDK_PATH}/src/access"
"${MATTER_SDK_PATH}/src/access/examples"
"${MATTER_SDK_PATH}/src/app"
"${MATTER_SDK_PATH}/src/app/icd/"
Expand Down Expand Up @@ -62,6 +61,7 @@ set(SRC_DIRS_LIST "."
"${MATTER_SDK_PATH}/zzz_generated/app-common/app-common/zap-generated")

set(INCLUDE_DIRS_LIST "."
"${MATTER_SDK_PATH}"
"${MATTER_SDK_PATH}/src"
"${MATTER_SDK_PATH}/src/access"
"${MATTER_SDK_PATH}/src/access/examples"
Expand Down Expand Up @@ -110,7 +110,6 @@ set(INCLUDE_DIRS_LIST "."
"${MATTER_SDK_PATH}/src/tracing"
"${MATTER_SDK_PATH}/src/transport"
"${MATTER_SDK_PATH}/src/transport/raw"
# "${MATTER_SDK_PATH}/out/host/gen/include"
"${MATTER_SDK_PATH}/third_party/nlfaultinjection/repo/include"
"${MATTER_SDK_PATH}/third_party/nlassert/repo/include"
"${MATTER_SDK_PATH}/third_party/nlio/repo/include"
Expand Down Expand Up @@ -423,13 +422,23 @@ target_compile_options(${COMPONENT_LIB} PUBLIC
"-DCHIP_CONFIG_SOFTWARE_VERSION_NUMBER=0")

if (CHIP_PROJECT_CONFIG)
set("chip_project_config_include" "\"${CHIP_PROJECT_CONFIG}\"")
set("chip_system_project_config_include" "\"${CHIP_PROJECT_CONFIG}\"")
# target_compile_options(${COMPONENT_LIB} PUBLIC
# "-DCHIP_PROJECT_CONFIG_INCLUDE=${chip_project_config_include}"
# "-DSYSTEM_PROJECT_CONFIG_INCLUDE=${chip_system_project_config_include}")
set(chip_project_config_include "${CHIP_PROJECT_CONFIG}")
set(chip_system_project_config_include "${CHIP_PROJECT_CONFIG}")
target_compile_options(${COMPONENT_LIB} PUBLIC
"-DCHIP_PROJECT_CONFIG_INCLUDE=${chip_project_config_include}"
"-DSYSTEM_PROJECT_CONFIG_INCLUDE=${chip_system_project_config_include}")
endif()

idf_build_set_property(C_COMPILE_OPTIONS "-Wno-error=uninitialized;-Wno-error=maybe-uninitialized;-Wno-format-nonliteral" APPEND)
idf_build_set_property(CXX_COMPILE_OPTIONS "-Wno-error=uninitialized;-Wno-error=maybe-uninitialized;-Wno-format-nonliteral" APPEND)

idf_component_get_property(main_lib main COMPONENT_LIB)
set(chip_libraries $<TARGET_FILE:${main_lib}>)

target_link_libraries(${COMPONENT_LIB} INTERFACE -Wl,--start-group
${chip_libraries}
-Wl,--end-group)

if (CONFIG_ENABLE_OTA_REQUESTOR)
target_compile_options(${COMPONENT_LIB} PUBLIC "-DCHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR=1")
endif()
Expand Down

0 comments on commit 00d690b

Please sign in to comment.