From 976ae2e7010345242f85f0862aa1134b03a57f5f Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Wed, 11 Sep 2024 15:45:29 -0400 Subject: [PATCH 1/2] Separate out the cmake logic a bit. Still somewhat broken through as the codegen data model is not built --- src/app/chip_data_model.cmake | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/src/app/chip_data_model.cmake b/src/app/chip_data_model.cmake index 499bf100256546..da6a6588e5d2e7 100644 --- a/src/app/chip_data_model.cmake +++ b/src/app/chip_data_model.cmake @@ -119,6 +119,27 @@ function(chip_configure_data_model APP_TARGET) set(APP_GEN_FILES) endif() + # These are: + # //src/app/icd/server:notfier + # //src/app/icd/server:monitoring-table + # //src/app/icd/server:configuration-data + # + # TODO: ideally we would avoid duplication and would link gn-built items. In this case + # it may be slightly harder because these are source_sets rather than libraries. + target_sources(${APP_TARGET} ${SCOPE} + ${CHIP_APP_BASE_DIR}/icd/server/ICDMonitoringTable.cpp +│ ${CHIP_APP_BASE_DIR}/icd/server/ICDNotifier.cpp +│ ${CHIP_APP_BASE_DIR}/icd/server/ICDConfigurationData.cpp + ) + + # This is: + # //src/app/common:cluster-objects + # + # TODO: ideally we would avoid duplication and would link gn-built items + target_sources(${APP_TARGET} ${SCOPE} + ${CHIP_APP_BASE_DIR}/../../zzz_generated/app-common/app-common/zap-generated/attributes/cluster-objects.cpp + ) + chip_zapgen(${APP_TARGET}-zapgen INPUT "${ARG_ZAP_FILE}" GENERATOR "app-templates" @@ -133,18 +154,12 @@ function(chip_configure_data_model APP_TARGET) target_include_directories(${APP_TARGET} ${SCOPE} "${APP_TEMPLATES_GEN_DIR}") add_dependencies(${APP_TARGET} ${APP_TARGET}-zapgen) - # TODO: source for codedgen_data_model ??? - target_sources(${APP_TARGET} ${SCOPE} ${CHIP_APP_BASE_DIR}/../../zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp - ${CHIP_APP_BASE_DIR}/../../zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp ${CHIP_APP_BASE_DIR}/reporting/reporting.cpp ${CHIP_APP_BASE_DIR}/util/attribute-storage.cpp ${CHIP_APP_BASE_DIR}/util/attribute-table.cpp ${CHIP_APP_BASE_DIR}/util/binding-table.cpp - ${CHIP_APP_BASE_DIR}/icd/server/ICDMonitoringTable.cpp - ${CHIP_APP_BASE_DIR}/icd/server/ICDNotifier.cpp - ${CHIP_APP_BASE_DIR}/icd/server/ICDConfigurationData.cpp ${CHIP_APP_BASE_DIR}/util/DataModelHandler.cpp ${CHIP_APP_BASE_DIR}/util/ember-compatibility-functions.cpp ${CHIP_APP_BASE_DIR}/util/ember-global-attribute-access-interface.cpp From 5f1e348e806b5ad52dee0dab3b13098fc9c6e65f Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Wed, 11 Sep 2024 15:57:40 -0400 Subject: [PATCH 2/2] Fix build and remove INCLUDE_SERVER cmake argument --- config/openiotsdk/cmake/chip.cmake | 1 - .../air-purifier-app/ameba/chip_main.cmake | 1 - .../telink/CMakeLists.txt | 1 - .../all-clusters-app/ameba/chip_main.cmake | 1 - examples/all-clusters-app/mbed/CMakeLists.txt | 1 - .../nrfconnect/CMakeLists.txt | 1 - .../nxp/zephyr/CMakeLists.txt | 1 - .../all-clusters-app/telink/CMakeLists.txt | 1 - .../ameba/chip_main.cmake | 1 - .../mbed/CMakeLists.txt | 1 - .../nrfconnect/CMakeLists.txt | 1 - .../telink/CMakeLists.txt | 1 - examples/bridge-app/telink/CMakeLists.txt | 1 - examples/chef/ameba/chip_main.cmake | 1 - examples/chef/nrfconnect/CMakeLists.txt | 1 - examples/chef/telink/CMakeLists.txt | 1 - .../contact-sensor-app/telink/CMakeLists.txt | 1 - .../nxp/zephyr/CMakeLists.txt | 1 - .../light-switch-app/ameba/chip_main.cmake | 1 - .../nrfconnect/CMakeLists.txt | 1 - .../light-switch-app/telink/CMakeLists.txt | 1 - examples/lighting-app/ameba/chip_main.cmake | 1 - examples/lighting-app/mbed/CMakeLists.txt | 1 - .../lighting-app/nrfconnect/CMakeLists.txt | 1 - examples/lighting-app/telink/CMakeLists.txt | 1 - .../lit-icd-app/nrfconnect/CMakeLists.txt | 1 - examples/lock-app/mbed/CMakeLists.txt | 1 - examples/lock-app/nrfconnect/CMakeLists.txt | 1 - examples/lock-app/telink/CMakeLists.txt | 1 - .../ota-requestor-app/ameba/chip_main.cmake | 1 - .../ota-requestor-app/mbed/CMakeLists.txt | 1 - .../ota-requestor-app/telink/CMakeLists.txt | 1 - examples/pump-app/nrfconnect/CMakeLists.txt | 1 - examples/pump-app/telink/CMakeLists.txt | 1 - .../nrfconnect/CMakeLists.txt | 1 - .../pump-controller-app/telink/CMakeLists.txt | 1 - .../smoke-co-alarm-app/telink/CMakeLists.txt | 1 - .../telink/CMakeLists.txt | 1 - examples/thermostat/nxp/zephyr/CMakeLists.txt | 1 - examples/thermostat/telink/CMakeLists.txt | 1 - examples/window-app/nrfconnect/CMakeLists.txt | 1 - examples/window-app/telink/CMakeLists.txt | 1 - src/app/chip_data_model.cmake | 36 +++++++++---------- 43 files changed, 17 insertions(+), 61 deletions(-) diff --git a/config/openiotsdk/cmake/chip.cmake b/config/openiotsdk/cmake/chip.cmake index a0eef560f926a9..fb1386e45d5dc6 100644 --- a/config/openiotsdk/cmake/chip.cmake +++ b/config/openiotsdk/cmake/chip.cmake @@ -74,7 +74,6 @@ function(chip_add_data_model target scope model_name) include(${CHIP_ROOT}/src/app/chip_data_model.cmake) chip_configure_data_model(${target} SCOPE ${scope} - INCLUDE_SERVER ZAP_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../${model_name}-common/${model_name}-app.zap ) endfunction() diff --git a/examples/air-purifier-app/ameba/chip_main.cmake b/examples/air-purifier-app/ameba/chip_main.cmake index c2a8d0e928fa0c..22a325bf6eddec 100755 --- a/examples/air-purifier-app/ameba/chip_main.cmake +++ b/examples/air-purifier-app/ameba/chip_main.cmake @@ -162,7 +162,6 @@ add_library( ) chip_configure_data_model(chip_main - INCLUDE_SERVER ZAP_FILE ${matter_example_path}/../air-purifier-common/air-purifier-app.zap ) diff --git a/examples/air-quality-sensor-app/telink/CMakeLists.txt b/examples/air-quality-sensor-app/telink/CMakeLists.txt index 4d34c74fcdba68..0cde6d4eb3f84a 100644 --- a/examples/air-quality-sensor-app/telink/CMakeLists.txt +++ b/examples/air-quality-sensor-app/telink/CMakeLists.txt @@ -53,7 +53,6 @@ target_sources(app PRIVATE ${TELINK_COMMON}/zephyr_ext/zephyr_ws2812.c) chip_configure_data_model(app - INCLUDE_SERVER ZAP_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../air-quality-sensor-common/air-quality-sensor-app.zap ) diff --git a/examples/all-clusters-app/ameba/chip_main.cmake b/examples/all-clusters-app/ameba/chip_main.cmake index 363b01e05ac2de..852673d07dd20c 100644 --- a/examples/all-clusters-app/ameba/chip_main.cmake +++ b/examples/all-clusters-app/ameba/chip_main.cmake @@ -212,7 +212,6 @@ add_library( ) chip_configure_data_model(chip_main - INCLUDE_SERVER ZAP_FILE ${matter_example_path}/../all-clusters-common/all-clusters-app.zap ) diff --git a/examples/all-clusters-app/mbed/CMakeLists.txt b/examples/all-clusters-app/mbed/CMakeLists.txt index b2e54ed28a78d6..ea1ce468b53852 100644 --- a/examples/all-clusters-app/mbed/CMakeLists.txt +++ b/examples/all-clusters-app/mbed/CMakeLists.txt @@ -87,7 +87,6 @@ target_sources(${APP_TARGET} PRIVATE ) chip_configure_data_model(${APP_TARGET} - INCLUDE_SERVER ZAP_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../all-clusters-common/all-clusters-app.zap ) diff --git a/examples/all-clusters-app/nrfconnect/CMakeLists.txt b/examples/all-clusters-app/nrfconnect/CMakeLists.txt index bed8169e40bd92..adfc76c299eb09 100644 --- a/examples/all-clusters-app/nrfconnect/CMakeLists.txt +++ b/examples/all-clusters-app/nrfconnect/CMakeLists.txt @@ -77,7 +77,6 @@ target_sources(app PRIVATE ${NRFCONNECT_COMMON}/util/LEDWidget.cpp) chip_configure_data_model(app - INCLUDE_SERVER ZAP_FILE ${ALL_CLUSTERS_COMMON_DIR}/all-clusters-app.zap ) diff --git a/examples/all-clusters-app/nxp/zephyr/CMakeLists.txt b/examples/all-clusters-app/nxp/zephyr/CMakeLists.txt index 2fa2d558a2724a..e5b9dff398abc7 100644 --- a/examples/all-clusters-app/nxp/zephyr/CMakeLists.txt +++ b/examples/all-clusters-app/nxp/zephyr/CMakeLists.txt @@ -82,7 +82,6 @@ if(CONFIG_CHIP_OTA_REQUESTOR) endif() chip_configure_data_model(app - INCLUDE_SERVER ZAP_FILE ${ALL_CLUSTERS_COMMON_DIR}/all-clusters-app.zap ) diff --git a/examples/all-clusters-app/telink/CMakeLists.txt b/examples/all-clusters-app/telink/CMakeLists.txt index 1eba5072690a6d..ddec4db229adc6 100644 --- a/examples/all-clusters-app/telink/CMakeLists.txt +++ b/examples/all-clusters-app/telink/CMakeLists.txt @@ -76,7 +76,6 @@ target_sources(app PRIVATE ${TELINK_COMMON}/zephyr_ext/zephyr_ws2812.c) chip_configure_data_model(app - INCLUDE_SERVER ZAP_FILE ${ALL_CLUSTERS_COMMON_DIR}/all-clusters-app.zap ) diff --git a/examples/all-clusters-minimal-app/ameba/chip_main.cmake b/examples/all-clusters-minimal-app/ameba/chip_main.cmake index e8fa8393ddeb1c..a2d1e364d63ee9 100755 --- a/examples/all-clusters-minimal-app/ameba/chip_main.cmake +++ b/examples/all-clusters-minimal-app/ameba/chip_main.cmake @@ -147,7 +147,6 @@ add_library( ) chip_configure_data_model(chip_main - INCLUDE_SERVER ZAP_FILE ${matter_example_path}/../all-clusters-common/all-clusters-minimal-app.zap ) diff --git a/examples/all-clusters-minimal-app/mbed/CMakeLists.txt b/examples/all-clusters-minimal-app/mbed/CMakeLists.txt index e50fcef67663f8..d90c3faaa496b3 100644 --- a/examples/all-clusters-minimal-app/mbed/CMakeLists.txt +++ b/examples/all-clusters-minimal-app/mbed/CMakeLists.txt @@ -65,7 +65,6 @@ target_sources(${APP_TARGET} PRIVATE ) chip_configure_data_model(${APP_TARGET} - INCLUDE_SERVER ZAP_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../all-clusters-common/all-clusters-minimal-app.zap ) diff --git a/examples/all-clusters-minimal-app/nrfconnect/CMakeLists.txt b/examples/all-clusters-minimal-app/nrfconnect/CMakeLists.txt index 08feb83a62a40b..d18fb15d33dd1a 100644 --- a/examples/all-clusters-minimal-app/nrfconnect/CMakeLists.txt +++ b/examples/all-clusters-minimal-app/nrfconnect/CMakeLists.txt @@ -55,7 +55,6 @@ target_sources(app PRIVATE ${NRFCONNECT_COMMON}/util/LEDWidget.cpp) chip_configure_data_model(app - INCLUDE_SERVER ZAP_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../all-clusters-common/all-clusters-minimal-app.zap ) diff --git a/examples/all-clusters-minimal-app/telink/CMakeLists.txt b/examples/all-clusters-minimal-app/telink/CMakeLists.txt index 3cfcc56d36783c..a9da3ae4331a15 100644 --- a/examples/all-clusters-minimal-app/telink/CMakeLists.txt +++ b/examples/all-clusters-minimal-app/telink/CMakeLists.txt @@ -55,7 +55,6 @@ target_sources(app PRIVATE ${TELINK_COMMON}/zephyr_ext/zephyr_ws2812.c) chip_configure_data_model(app - INCLUDE_SERVER ZAP_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../all-clusters-common/all-clusters-minimal-app.zap ) diff --git a/examples/bridge-app/telink/CMakeLists.txt b/examples/bridge-app/telink/CMakeLists.txt index 1da3944812e014..f2e80864d46e01 100644 --- a/examples/bridge-app/telink/CMakeLists.txt +++ b/examples/bridge-app/telink/CMakeLists.txt @@ -52,7 +52,6 @@ target_sources(app PRIVATE ${TELINK_COMMON}/zephyr_ext/zephyr_ws2812.c) chip_configure_data_model(app - INCLUDE_SERVER ZAP_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../bridge-common/bridge-app.zap ) diff --git a/examples/chef/ameba/chip_main.cmake b/examples/chef/ameba/chip_main.cmake index df9f7fedd10ecc..87c8aa158db8bb 100755 --- a/examples/chef/ameba/chip_main.cmake +++ b/examples/chef/ameba/chip_main.cmake @@ -51,7 +51,6 @@ add_library( ) chip_configure_data_model(chip_main - INCLUDE_SERVER ZAP_FILE ${matter_example_path}/../devices/${SAMPLE_NAME}.zap ) diff --git a/examples/chef/nrfconnect/CMakeLists.txt b/examples/chef/nrfconnect/CMakeLists.txt index 081c510435c1e6..13ddc003e3b878 100644 --- a/examples/chef/nrfconnect/CMakeLists.txt +++ b/examples/chef/nrfconnect/CMakeLists.txt @@ -106,7 +106,6 @@ target_sources(app PRIVATE message(STATUS ${CHEF}/devices/${CONFIG_CHEF_DEVICE_TYPE}.zap) chip_configure_data_model(app - INCLUDE_SERVER ZAP_FILE ${CHEF}/devices/${CONFIG_CHEF_DEVICE_TYPE}.zap ) diff --git a/examples/chef/telink/CMakeLists.txt b/examples/chef/telink/CMakeLists.txt index 3c6b352e55b873..364725c34383fc 100755 --- a/examples/chef/telink/CMakeLists.txt +++ b/examples/chef/telink/CMakeLists.txt @@ -77,7 +77,6 @@ target_sources(app PRIVATE message(STATUS ${CHEF}/devices/${SAMPLE_NAME}.zap) chip_configure_data_model(app - INCLUDE_SERVER ZAP_FILE ${CHEF}/devices/${SAMPLE_NAME}.zap ) diff --git a/examples/contact-sensor-app/telink/CMakeLists.txt b/examples/contact-sensor-app/telink/CMakeLists.txt index fb8098b36fdbee..47ec8757942519 100755 --- a/examples/contact-sensor-app/telink/CMakeLists.txt +++ b/examples/contact-sensor-app/telink/CMakeLists.txt @@ -51,7 +51,6 @@ target_sources(app PRIVATE ${TELINK_COMMON}/zephyr_ext/zephyr_ws2812.c) chip_configure_data_model(app - INCLUDE_SERVER ZAP_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../contact-sensor-common/contact-sensor-app.zap ) diff --git a/examples/laundry-washer-app/nxp/zephyr/CMakeLists.txt b/examples/laundry-washer-app/nxp/zephyr/CMakeLists.txt index f7b32881ada959..9103b6a5567102 100644 --- a/examples/laundry-washer-app/nxp/zephyr/CMakeLists.txt +++ b/examples/laundry-washer-app/nxp/zephyr/CMakeLists.txt @@ -84,7 +84,6 @@ if(CONFIG_CHIP_OTA_REQUESTOR) endif() chip_configure_data_model(app - INCLUDE_SERVER ZAP_FILE ${ALL_CLUSTERS_COMMON_DIR}/../../laundry-washer-app/nxp/zap/laundry-washer-app.zap ) diff --git a/examples/light-switch-app/ameba/chip_main.cmake b/examples/light-switch-app/ameba/chip_main.cmake index 75e0d0116425fe..629c423c0fe5ec 100755 --- a/examples/light-switch-app/ameba/chip_main.cmake +++ b/examples/light-switch-app/ameba/chip_main.cmake @@ -173,7 +173,6 @@ add_library( ) chip_configure_data_model(chip_main - INCLUDE_SERVER ZAP_FILE ${matter_example_path}/../light-switch-common/light-switch-app.zap ) diff --git a/examples/light-switch-app/nrfconnect/CMakeLists.txt b/examples/light-switch-app/nrfconnect/CMakeLists.txt index 48329e053be562..3eec4764d96ec9 100644 --- a/examples/light-switch-app/nrfconnect/CMakeLists.txt +++ b/examples/light-switch-app/nrfconnect/CMakeLists.txt @@ -64,6 +64,5 @@ if(CONFIG_MCUMGR_TRANSPORT_BT) endif() chip_configure_data_model(app - INCLUDE_SERVER ZAP_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../light-switch-common/light-switch-app.zap ) diff --git a/examples/light-switch-app/telink/CMakeLists.txt b/examples/light-switch-app/telink/CMakeLists.txt index 7b98b235ea66e1..660769df9a59c4 100755 --- a/examples/light-switch-app/telink/CMakeLists.txt +++ b/examples/light-switch-app/telink/CMakeLists.txt @@ -52,7 +52,6 @@ target_sources(app PRIVATE ${TELINK_COMMON}/zephyr_ext/zephyr_ws2812.c) chip_configure_data_model(app - INCLUDE_SERVER ZAP_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../light-switch-common/light-switch-app.zap ) diff --git a/examples/lighting-app/ameba/chip_main.cmake b/examples/lighting-app/ameba/chip_main.cmake index 3165047d3955be..11590553cf327d 100755 --- a/examples/lighting-app/ameba/chip_main.cmake +++ b/examples/lighting-app/ameba/chip_main.cmake @@ -166,7 +166,6 @@ add_library( ) chip_configure_data_model(chip_main - INCLUDE_SERVER ZAP_FILE ${matter_example_path}/../lighting-common/lighting-app.zap ) diff --git a/examples/lighting-app/mbed/CMakeLists.txt b/examples/lighting-app/mbed/CMakeLists.txt index abe63789638f23..69456ae04664dd 100644 --- a/examples/lighting-app/mbed/CMakeLists.txt +++ b/examples/lighting-app/mbed/CMakeLists.txt @@ -62,7 +62,6 @@ target_sources(${APP_TARGET} PRIVATE ) chip_configure_data_model(${APP_TARGET} - INCLUDE_SERVER ZAP_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../lighting-common/lighting-app.zap ) diff --git a/examples/lighting-app/nrfconnect/CMakeLists.txt b/examples/lighting-app/nrfconnect/CMakeLists.txt index 5b2647894e9ffb..59bf2f26bed466 100644 --- a/examples/lighting-app/nrfconnect/CMakeLists.txt +++ b/examples/lighting-app/nrfconnect/CMakeLists.txt @@ -55,7 +55,6 @@ target_sources(app PRIVATE ${NRFCONNECT_COMMON}/util/PWMDevice.cpp) chip_configure_data_model(app - INCLUDE_SERVER ZAP_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../lighting-common/lighting-app.zap ) diff --git a/examples/lighting-app/telink/CMakeLists.txt b/examples/lighting-app/telink/CMakeLists.txt index 056f6d4173c49a..9e29436a05f5fa 100644 --- a/examples/lighting-app/telink/CMakeLists.txt +++ b/examples/lighting-app/telink/CMakeLists.txt @@ -52,7 +52,6 @@ target_sources(app PRIVATE ${TELINK_COMMON}/zephyr_ext/zephyr_ws2812.c) chip_configure_data_model(app - INCLUDE_SERVER ZAP_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../lighting-common/lighting-app.zap ) diff --git a/examples/lit-icd-app/nrfconnect/CMakeLists.txt b/examples/lit-icd-app/nrfconnect/CMakeLists.txt index 36133c49ec12d1..a624da1b22fef0 100644 --- a/examples/lit-icd-app/nrfconnect/CMakeLists.txt +++ b/examples/lit-icd-app/nrfconnect/CMakeLists.txt @@ -50,7 +50,6 @@ target_sources(app PRIVATE ${NRFCONNECT_COMMON}/util/LEDWidget.cpp) chip_configure_data_model(app - INCLUDE_SERVER ZAP_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../lit-icd-common/lit-icd-server-app.zap ) diff --git a/examples/lock-app/mbed/CMakeLists.txt b/examples/lock-app/mbed/CMakeLists.txt index 29cb86631ab749..5d9a5f5554c8d4 100644 --- a/examples/lock-app/mbed/CMakeLists.txt +++ b/examples/lock-app/mbed/CMakeLists.txt @@ -62,7 +62,6 @@ target_sources(${APP_TARGET} PRIVATE ) chip_configure_data_model(${APP_TARGET} - INCLUDE_SERVER ZAP_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../lock-common/lock-app.zap ) diff --git a/examples/lock-app/nrfconnect/CMakeLists.txt b/examples/lock-app/nrfconnect/CMakeLists.txt index 6c92305f378dec..27ed04aceb4e01 100644 --- a/examples/lock-app/nrfconnect/CMakeLists.txt +++ b/examples/lock-app/nrfconnect/CMakeLists.txt @@ -52,7 +52,6 @@ target_sources(app PRIVATE ${NRFCONNECT_COMMON}/util/LEDWidget.cpp) chip_configure_data_model(app - INCLUDE_SERVER ZAP_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../lock-common/lock-app.zap ) diff --git a/examples/lock-app/telink/CMakeLists.txt b/examples/lock-app/telink/CMakeLists.txt index ee3b67b82eb15d..b2598b171f7712 100755 --- a/examples/lock-app/telink/CMakeLists.txt +++ b/examples/lock-app/telink/CMakeLists.txt @@ -53,7 +53,6 @@ target_sources(app PRIVATE ${TELINK_COMMON}/zephyr_ext/zephyr_ws2812.c) chip_configure_data_model(app - INCLUDE_SERVER ZAP_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../lock-common/lock-app.zap ) diff --git a/examples/ota-requestor-app/ameba/chip_main.cmake b/examples/ota-requestor-app/ameba/chip_main.cmake index 1a418260dbb294..28b2fb5d20431d 100644 --- a/examples/ota-requestor-app/ameba/chip_main.cmake +++ b/examples/ota-requestor-app/ameba/chip_main.cmake @@ -39,7 +39,6 @@ add_library( ) chip_configure_data_model(chip_main - INCLUDE_SERVER ZAP_FILE ${matter_example_path}/../ota-requestor-common/ota-requestor-app.zap ) diff --git a/examples/ota-requestor-app/mbed/CMakeLists.txt b/examples/ota-requestor-app/mbed/CMakeLists.txt index d377b0ee60b6b3..3bb074ea49e213 100644 --- a/examples/ota-requestor-app/mbed/CMakeLists.txt +++ b/examples/ota-requestor-app/mbed/CMakeLists.txt @@ -60,7 +60,6 @@ target_sources(${APP_TARGET} PRIVATE ) chip_configure_data_model(${APP_TARGET} - INCLUDE_SERVER ZAP_FILE ${CHIP_ROOT}/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.zap ) diff --git a/examples/ota-requestor-app/telink/CMakeLists.txt b/examples/ota-requestor-app/telink/CMakeLists.txt index 62ed3c85deb51a..c4ac02600cb1ef 100644 --- a/examples/ota-requestor-app/telink/CMakeLists.txt +++ b/examples/ota-requestor-app/telink/CMakeLists.txt @@ -51,7 +51,6 @@ target_sources(app PRIVATE ${TELINK_COMMON}/zephyr_ext/zephyr_ws2812.c) chip_configure_data_model(app - INCLUDE_SERVER ZAP_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../ota-requestor-common/ota-requestor-app.zap ) diff --git a/examples/pump-app/nrfconnect/CMakeLists.txt b/examples/pump-app/nrfconnect/CMakeLists.txt index b599faaa1dd863..476494c4c07056 100644 --- a/examples/pump-app/nrfconnect/CMakeLists.txt +++ b/examples/pump-app/nrfconnect/CMakeLists.txt @@ -52,7 +52,6 @@ target_sources(app PRIVATE ${NRFCONNECT_COMMON}/util/LEDWidget.cpp) chip_configure_data_model(app - INCLUDE_SERVER ZAP_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../pump-common/pump-app.zap ) diff --git a/examples/pump-app/telink/CMakeLists.txt b/examples/pump-app/telink/CMakeLists.txt index 79334332003646..707abb6ee26def 100755 --- a/examples/pump-app/telink/CMakeLists.txt +++ b/examples/pump-app/telink/CMakeLists.txt @@ -50,7 +50,6 @@ target_sources(app PRIVATE ${TELINK_COMMON}/zephyr_ext/zephyr_ws2812.c) chip_configure_data_model(app - INCLUDE_SERVER ZAP_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../pump-common/pump-app.zap ) diff --git a/examples/pump-controller-app/nrfconnect/CMakeLists.txt b/examples/pump-controller-app/nrfconnect/CMakeLists.txt index 98d43aefafeb71..8eea9be7dac58d 100644 --- a/examples/pump-controller-app/nrfconnect/CMakeLists.txt +++ b/examples/pump-controller-app/nrfconnect/CMakeLists.txt @@ -52,7 +52,6 @@ target_sources(app PRIVATE ${NRFCONNECT_COMMON}/util/LEDWidget.cpp) chip_configure_data_model(app - INCLUDE_SERVER ZAP_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../pump-controller-common/pump-controller-app.zap ) diff --git a/examples/pump-controller-app/telink/CMakeLists.txt b/examples/pump-controller-app/telink/CMakeLists.txt index 3aeb7775e0555f..4b54bd87242b9a 100755 --- a/examples/pump-controller-app/telink/CMakeLists.txt +++ b/examples/pump-controller-app/telink/CMakeLists.txt @@ -50,7 +50,6 @@ target_sources(app PRIVATE ${TELINK_COMMON}/zephyr_ext/zephyr_ws2812.c) chip_configure_data_model(app - INCLUDE_SERVER ZAP_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../pump-controller-common/pump-controller-app.zap ) diff --git a/examples/smoke-co-alarm-app/telink/CMakeLists.txt b/examples/smoke-co-alarm-app/telink/CMakeLists.txt index 768123896dc3e2..2f5690fb4f0576 100755 --- a/examples/smoke-co-alarm-app/telink/CMakeLists.txt +++ b/examples/smoke-co-alarm-app/telink/CMakeLists.txt @@ -51,7 +51,6 @@ target_sources(app PRIVATE ${TELINK_COMMON}/zephyr_ext/zephyr_ws2812.c) chip_configure_data_model(app - INCLUDE_SERVER ZAP_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../smoke-co-alarm-common/smoke-co-alarm-app.zap ) diff --git a/examples/temperature-measurement-app/telink/CMakeLists.txt b/examples/temperature-measurement-app/telink/CMakeLists.txt index 7089f7ca50fb0b..a271abf295765b 100644 --- a/examples/temperature-measurement-app/telink/CMakeLists.txt +++ b/examples/temperature-measurement-app/telink/CMakeLists.txt @@ -53,7 +53,6 @@ target_sources(app PRIVATE ${TELINK_COMMON}/zephyr_ext/zephyr_ws2812.c) chip_configure_data_model(app - INCLUDE_SERVER ZAP_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../temperature-measurement-common/temperature-measurement.zap ) diff --git a/examples/thermostat/nxp/zephyr/CMakeLists.txt b/examples/thermostat/nxp/zephyr/CMakeLists.txt index 2b0fb87a55e7f9..b478cfff9f2566 100644 --- a/examples/thermostat/nxp/zephyr/CMakeLists.txt +++ b/examples/thermostat/nxp/zephyr/CMakeLists.txt @@ -84,7 +84,6 @@ if(CONFIG_CHIP_OTA_REQUESTOR) endif() chip_configure_data_model(app - INCLUDE_SERVER ZAP_FILE ${ALL_CLUSTERS_COMMON_DIR}/../../thermostat/nxp/zap/thermostat_matter_wifi.zap ) diff --git a/examples/thermostat/telink/CMakeLists.txt b/examples/thermostat/telink/CMakeLists.txt index 74a2565ba4a60e..166d8b8189a8e8 100755 --- a/examples/thermostat/telink/CMakeLists.txt +++ b/examples/thermostat/telink/CMakeLists.txt @@ -53,7 +53,6 @@ target_sources(app PRIVATE ${TELINK_COMMON}/zephyr_ext/zephyr_ws2812.c) chip_configure_data_model(app - INCLUDE_SERVER ZAP_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../thermostat-common/thermostat.zap ) diff --git a/examples/window-app/nrfconnect/CMakeLists.txt b/examples/window-app/nrfconnect/CMakeLists.txt index e6f7ebca632047..7418f7054649ef 100644 --- a/examples/window-app/nrfconnect/CMakeLists.txt +++ b/examples/window-app/nrfconnect/CMakeLists.txt @@ -55,7 +55,6 @@ target_sources(app PRIVATE ${NRFCONNECT_COMMON}/util/PWMDevice.cpp) chip_configure_data_model(app - INCLUDE_SERVER ZAP_FILE ${WIN_APP_COMMON_DIR}/window-app.zap ) diff --git a/examples/window-app/telink/CMakeLists.txt b/examples/window-app/telink/CMakeLists.txt index a5ff986798de1e..1a7a4611c81d9f 100644 --- a/examples/window-app/telink/CMakeLists.txt +++ b/examples/window-app/telink/CMakeLists.txt @@ -53,7 +53,6 @@ target_sources(app PRIVATE ) chip_configure_data_model(app - INCLUDE_SERVER ZAP_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../common/window-app.zap ) diff --git a/src/app/chip_data_model.cmake b/src/app/chip_data_model.cmake index da6a6588e5d2e7..e2d05adb01e4a1 100644 --- a/src/app/chip_data_model.cmake +++ b/src/app/chip_data_model.cmake @@ -60,7 +60,6 @@ endfunction() # Available options are: # SCOPE CMake scope keyword that defines the scope of included sources. # The default is PRIVATE scope. -# INCLUDE_SERVER Include source files from src/app/server directory. # ZAP_FILE Path to the ZAP file, used to determine the list of clusters # supported by the application. # IDL .matter IDL file to use for codegen. Inferred from ZAP_FILE @@ -71,27 +70,26 @@ endfunction() # function(chip_configure_data_model APP_TARGET) set(SCOPE PRIVATE) - cmake_parse_arguments(ARG "INCLUDE_SERVER" "SCOPE;ZAP_FILE;IDL" "EXTERNAL_CLUSTERS" ${ARGN}) + cmake_parse_arguments(ARG "" "SCOPE;ZAP_FILE;IDL" "EXTERNAL_CLUSTERS" ${ARGN}) if(ARG_SCOPE) set(SCOPE ${ARG_SCOPE}) endif() - if(ARG_INCLUDE_SERVER) - target_sources(${APP_TARGET} ${SCOPE} - ${CHIP_APP_BASE_DIR}/server/AclStorage.cpp - ${CHIP_APP_BASE_DIR}/server/DefaultAclStorage.cpp - ${CHIP_APP_BASE_DIR}/server/CommissioningWindowManager.cpp - ${CHIP_APP_BASE_DIR}/server/Dnssd.cpp - ${CHIP_APP_BASE_DIR}/server/EchoHandler.cpp - ${CHIP_APP_BASE_DIR}/server/OnboardingCodesUtil.cpp - ${CHIP_APP_BASE_DIR}/server/Server.cpp - ) + # CMAKE data model auto-includes the server side implementation + target_sources(${APP_TARGET} ${SCOPE} + ${CHIP_APP_BASE_DIR}/server/AclStorage.cpp + ${CHIP_APP_BASE_DIR}/server/DefaultAclStorage.cpp + ${CHIP_APP_BASE_DIR}/server/CommissioningWindowManager.cpp + ${CHIP_APP_BASE_DIR}/server/Dnssd.cpp + ${CHIP_APP_BASE_DIR}/server/EchoHandler.cpp + ${CHIP_APP_BASE_DIR}/server/OnboardingCodesUtil.cpp + ${CHIP_APP_BASE_DIR}/server/Server.cpp + ) - target_compile_options(${APP_TARGET} ${SCOPE} - "-DCHIP_ADDRESS_RESOLVE_IMPL_INCLUDE_HEADER=" - ) - endif() + target_compile_options(${APP_TARGET} ${SCOPE} + "-DCHIP_ADDRESS_RESOLVE_IMPL_INCLUDE_HEADER=" + ) if(ARG_ZAP_FILE) chip_configure_zap_file(${APP_TARGET} ${ARG_ZAP_FILE} "${ARG_EXTERNAL_CLUSTERS}") @@ -128,8 +126,8 @@ function(chip_configure_data_model APP_TARGET) # it may be slightly harder because these are source_sets rather than libraries. target_sources(${APP_TARGET} ${SCOPE} ${CHIP_APP_BASE_DIR}/icd/server/ICDMonitoringTable.cpp -│ ${CHIP_APP_BASE_DIR}/icd/server/ICDNotifier.cpp -│ ${CHIP_APP_BASE_DIR}/icd/server/ICDConfigurationData.cpp + ${CHIP_APP_BASE_DIR}/icd/server/ICDNotifier.cpp + ${CHIP_APP_BASE_DIR}/icd/server/ICDConfigurationData.cpp ) # This is: @@ -137,7 +135,7 @@ function(chip_configure_data_model APP_TARGET) # # TODO: ideally we would avoid duplication and would link gn-built items target_sources(${APP_TARGET} ${SCOPE} - ${CHIP_APP_BASE_DIR}/../../zzz_generated/app-common/app-common/zap-generated/attributes/cluster-objects.cpp + ${CHIP_APP_BASE_DIR}/../../zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp ) chip_zapgen(${APP_TARGET}-zapgen