Skip to content

Commit 3e74147

Browse files
adigiejuandediosg
authored andcommitted
Remove ICD server sources from chip_data_model.cmake (project-chip#37513)
* Remove ICD server sources from chip_data_model.cmake ICD server sources are built by gn, there is no need to compile them twice. Signed-off-by: Adrian Gielniewski <adrian.gielniewski@nordicsemi.no> * Fix ICD dependencies Don't depend on ICD if it's not enabled. Signed-off-by: Adrian Gielniewski <adrian.gielniewski@nordicsemi.no> * Fix gn include warnings Signed-off-by: Adrian Gielniewski <adrian.gielniewski@nordicsemi.no> * iOS TVCasting app: Add missing chip_project_config_include `chip_project_config_include` has to be set to get correct include order of configuration files in `CHIPDeviceConfig.h` and prevent macro redefined warnings coming from overriding defines already defined by `CHIPConfig.h`. Signed-off-by: Adrian Gielniewski <adrian.gielniewski@nordicsemi.no> --------- Signed-off-by: Adrian Gielniewski <adrian.gielniewski@nordicsemi.no>
1 parent 2c467fe commit 3e74147

File tree

13 files changed

+26
-31
lines changed

13 files changed

+26
-31
lines changed

examples/light-switch-app/cc13x4_26x4/src/AppTask.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
#include <ti/drivers/apps/LED.h>
6363

6464
#if CHIP_CONFIG_ENABLE_ICD_UAT
65-
#include "app/icd/server/ICDNotifier.h"
65+
#include "app/icd/server/ICDNotifier.h" // nogncheck
6666
#endif
6767

6868
/* syscfg */

examples/lighting-app/cc13x4_26x4/src/AppTask.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
#include <ti/drivers/apps/LED.h>
5858

5959
#if CHIP_CONFIG_ENABLE_ICD_UAT
60-
#include "app/icd/server/ICDNotifier.h"
60+
#include "app/icd/server/ICDNotifier.h" // nogncheck
6161
#endif
6262

6363
/* syscfg */

examples/lock-app/cc13x4_26x4/src/AppTask.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
#include <ti/drivers/apps/LED.h>
5757

5858
#if CHIP_CONFIG_ENABLE_ICD_UAT
59-
#include "app/icd/server/ICDNotifier.h"
59+
#include "app/icd/server/ICDNotifier.h" // nogncheck
6060
#endif
6161

6262
/* syscfg */

examples/platform/linux/AppMain.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
#include <app/clusters/device-energy-management-server/DeviceEnergyManagementTestEventTriggerHandler.h>
9999
#endif
100100
#if CHIP_CONFIG_ENABLE_ICD_SERVER
101-
#include <app/icd/server/ICDManager.h>
101+
#include <app/icd/server/ICDManager.h> // nogncheck
102102
#endif
103103
#include <app/TestEventTriggerDelegate.h>
104104

examples/pump-app/cc13x4_26x4/main/AppTask.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
#include <ti/drivers/apps/LED.h>
5959

6060
#if CHIP_CONFIG_ENABLE_ICD_UAT
61-
#include "app/icd/server/ICDNotifier.h"
61+
#include "app/icd/server/ICDNotifier.h" // nogncheck
6262
#endif
6363

6464
/* syscfg */

examples/pump-controller-app/cc13x4_26x4/main/AppTask.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
#include <ti/drivers/apps/LED.h>
5454

5555
#if CHIP_CONFIG_ENABLE_ICD_UAT
56-
#include "app/icd/server/ICDNotifier.h"
56+
#include "app/icd/server/ICDNotifier.h" // nogncheck
5757
#endif
5858

5959
/* syscfg */

examples/tv-casting-app/darwin/args.gni

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import("//build_overrides/chip.gni")
1717
import("${chip_root}/config/darwin/args.gni")
1818

1919
chip_device_project_config_include = "<CHIPProjectAppConfig.h>"
20+
chip_project_config_include = "<CHIPProjectAppConfig.h>"
2021

2122
chip_project_config_include_dirs = [
2223
"${chip_root}/examples/tv-casting-app/tv-casting-common/include",

src/app/BUILD.gn

+5-1
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,6 @@ static_library("interaction-model") {
228228
"${chip_root}/src/app/MessageDef",
229229
"${chip_root}/src/app/data-model-provider",
230230
"${chip_root}/src/app/icd/server:icd-server-config",
231-
"${chip_root}/src/app/icd/server:manager",
232231
"${chip_root}/src/app/icd/server:observer",
233232
"${chip_root}/src/app/util:af-types",
234233
"${chip_root}/src/app/util:callbacks",
@@ -240,6 +239,10 @@ static_library("interaction-model") {
240239
"${chip_root}/src/system",
241240
]
242241

242+
if (chip_enable_icd_server) {
243+
public_deps += [ "${chip_root}/src/app/icd/server:manager" ]
244+
}
245+
243246
public_configs = [ "${chip_root}/src:includes" ]
244247

245248
if (chip_enable_read_client) {
@@ -485,6 +488,7 @@ static_library("app") {
485488
":global-attributes",
486489
":interaction-model",
487490
":path-expansion",
491+
":test-event-trigger",
488492
"${chip_root}/src/app/data-model",
489493
"${chip_root}/src/app/data-model-provider",
490494
"${chip_root}/src/app/icd/server:icd-server-config",

src/app/chip_data_model.cmake

-13
Original file line numberDiff line numberDiff line change
@@ -119,19 +119,6 @@ function(chip_configure_data_model APP_TARGET)
119119
set(APP_GEN_FILES)
120120
endif()
121121

122-
# These are:
123-
# //src/app/icd/server:notfier
124-
# //src/app/icd/server:monitoring-table
125-
# //src/app/icd/server:configuration-data
126-
#
127-
# TODO: ideally we would avoid duplication and would link gn-built items. In this case
128-
# it may be slightly harder because these are source_sets rather than libraries.
129-
target_sources(${APP_TARGET} ${SCOPE}
130-
${CHIP_APP_BASE_DIR}/icd/server/ICDMonitoringTable.cpp
131-
${CHIP_APP_BASE_DIR}/icd/server/ICDNotifier.cpp
132-
${CHIP_APP_BASE_DIR}/icd/server/ICDConfigurationData.cpp
133-
)
134-
135122
# This is:
136123
# //src/app/common:cluster-objects
137124
#

src/app/chip_data_model.gni

+7-2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import("//build_overrides/build.gni")
1616
import("//build_overrides/chip.gni")
1717
import("${chip_root}/build/chip/chip_codegen.gni")
1818
import("${chip_root}/src/app/common_flags.gni")
19+
import("${chip_root}/src/app/icd/icd.gni")
1920
import("${chip_root}/src/data-model-providers/codegen/model.gni")
2021
import("${chip_root}/src/platform/python.gni")
2122

@@ -340,9 +341,13 @@ template("chip_data_model") {
340341
deps += [
341342
"${chip_root}/src/app/icd/server:configuration-data",
342343
"${chip_root}/src/app/icd/server:icd-server-config",
343-
"${chip_root}/src/app/icd/server:monitoring-table",
344-
"${chip_root}/src/app/icd/server:notifier",
345344
]
345+
if (chip_enable_icd_server) {
346+
deps += [ "${chip_root}/src/app/icd/server:notifier" ]
347+
if (chip_enable_icd_checkin) {
348+
deps += [ "${chip_root}/src/app/icd/server:monitoring-table" ]
349+
}
350+
}
346351
} else if (cluster == "resource-monitoring-server") {
347352
sources += [
348353
"${_app_root}/clusters/${cluster}/${cluster}.cpp",

src/app/clusters/icd-management-server/icd-management-server.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@
2525
#include <app-common/zap-generated/ids/Clusters.h>
2626
#include <app/AttributeAccessInterface.h>
2727
#include <app/AttributeAccessInterfaceRegistry.h>
28-
#include <app/icd/server/ICDNotifier.h>
28+
#if CHIP_CONFIG_ENABLE_ICD_CIP
29+
#include <app/icd/server/ICDNotifier.h> // nogncheck
30+
#endif
2931
#include <app/server/Server.h>
3032
#include <app/util/attribute-storage.h>
3133

src/app/clusters/icd-management-server/icd-management-server.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
#if CHIP_CONFIG_ENABLE_ICD_CIP
3232
#include <app/ConcreteAttributePath.h>
33-
#include <app/icd/server/ICDMonitoringTable.h>
33+
#include <app/icd/server/ICDMonitoringTable.h> // nogncheck
3434
#include <lib/core/CHIPPersistentStorageDelegate.h>
3535
#endif // CHIP_CONFIG_ENABLE_ICD_CIP
3636

src/app/server/BUILD.gn

+3-7
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,8 @@ static_library("server") {
9191
# be updated if this is not really "testing" even though headers are Test*.h)
9292
public_deps += [ "${chip_root}/src/lib/support:testing" ]
9393

94-
if (chip_enable_icd_server) {
95-
public_deps += [ "${chip_root}/src/app/icd/server:notifier" ]
96-
97-
if (chip_enable_icd_checkin) {
98-
public_deps +=
99-
[ "${chip_root}/src/app/icd/server:default-check-in-back-off" ]
100-
}
94+
if (chip_enable_icd_checkin) {
95+
public_deps +=
96+
[ "${chip_root}/src/app/icd/server:default-check-in-back-off" ]
10197
}
10298
}

0 commit comments

Comments
 (0)