Michael Spang | efa630b | 2020-07-08 22:23:08 -0400 | [diff] [blame] | 1 | # Copyright (c) 2020 Project CHIP Authors |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
| 14 | |
| 15 | import("//build_overrides/chip.gni") |
Michael Spang | e00eac3 | 2021-06-21 17:25:47 -0400 | [diff] [blame] | 16 | import("${chip_root}/build/chip/buildconfig_header.gni") |
yunhanw-google | f473579 | 2023-10-24 20:42:50 -0700 | [diff] [blame] | 17 | import("${chip_root}/src/lib/core/core.gni") |
yunhanw-google | 6e3d045 | 2023-09-15 19:32:28 -0700 | [diff] [blame] | 18 | import("${chip_root}/src/platform/device.gni") |
Song Guo | a77a662 | 2021-01-29 13:13:02 +0800 | [diff] [blame] | 19 | import("common_flags.gni") |
mkardous-silabs | 9828293 | 2023-06-05 14:13:46 -0400 | [diff] [blame] | 20 | import("icd/icd.gni") |
Michael Spang | efa630b | 2020-07-08 22:23:08 -0400 | [diff] [blame] | 21 | |
yunhanw-google | d644bb0 | 2021-04-13 07:26:17 -0700 | [diff] [blame] | 22 | declare_args() { |
| 23 | # Enable strict schema checks. |
yunhanw-google | 751d0dd | 2022-11-16 19:09:58 -0800 | [diff] [blame] | 24 | enable_im_pretty_print = |
Boris Zbarsky | c17d723 | 2022-09-09 12:56:27 -0400 | [diff] [blame] | 25 | is_debug && (current_os == "linux" || current_os == "mac" || |
| 26 | current_os == "ios" || current_os == "android") |
Tennessee Carmel-Veilleux | 085acd0 | 2022-04-13 23:42:22 -0400 | [diff] [blame] | 27 | |
| 28 | # Logging verbosity control for Access Control implementation |
| 29 | # |
| 30 | # If set to > 0, it is desired to get additional logging on all |
| 31 | # access control checks for better debugging ability. |
| 32 | # |
| 33 | # If set to > 1, it is desired to log every single check |
| 34 | chip_access_control_policy_logging_verbosity = 0 |
| 35 | if (is_debug && (current_os == "linux" || current_os == "mac")) { |
| 36 | chip_access_control_policy_logging_verbosity = 2 |
| 37 | } |
| 38 | |
Zang MingJie | 7dede20 | 2022-04-06 11:54:50 +0800 | [diff] [blame] | 39 | chip_enable_session_resumption = true |
Song GUO | 077e44e | 2022-04-25 10:16:30 +0800 | [diff] [blame] | 40 | |
| 41 | # By default, the resources used by each fabric is unlimited if they are allocated on heap. This flag is for checking the resource usage even when they are allocated on heap to increase code coverage in integration tests. |
| 42 | chip_im_force_fabric_quota_check = false |
Evgeny Margolis | b89e83b | 2023-02-24 18:20:02 -1000 | [diff] [blame] | 43 | |
Andrei Litvin | 7baabb7 | 2023-07-28 13:47:45 -0400 | [diff] [blame] | 44 | enable_eventlist_attribute = false |
yunhanw-google | d644bb0 | 2021-04-13 07:26:17 -0700 | [diff] [blame] | 45 | } |
| 46 | |
Michael Spang | e00eac3 | 2021-06-21 17:25:47 -0400 | [diff] [blame] | 47 | buildconfig_header("app_buildconfig") { |
| 48 | header = "AppBuildConfig.h" |
| 49 | header_dir = "app" |
| 50 | |
Zang MingJie | 7dede20 | 2022-04-06 11:54:50 +0800 | [diff] [blame] | 51 | defines = [ |
yunhanw-google | 751d0dd | 2022-11-16 19:09:58 -0800 | [diff] [blame] | 52 | "CHIP_CONFIG_IM_PRETTY_PRINT=${enable_im_pretty_print}", |
Song GUO | 077e44e | 2022-04-25 10:16:30 +0800 | [diff] [blame] | 53 | "CHIP_CONFIG_IM_FORCE_FABRIC_QUOTA_CHECK=${chip_im_force_fabric_quota_check}", |
Zang MingJie | 7dede20 | 2022-04-06 11:54:50 +0800 | [diff] [blame] | 54 | "CHIP_CONFIG_ENABLE_SESSION_RESUMPTION=${chip_enable_session_resumption}", |
Tennessee Carmel-Veilleux | 085acd0 | 2022-04-13 23:42:22 -0400 | [diff] [blame] | 55 | "CHIP_CONFIG_ACCESS_CONTROL_POLICY_LOGGING_VERBOSITY=${chip_access_control_policy_logging_verbosity}", |
Jeff Tung | 19cb1a5 | 2023-01-26 05:56:05 -0800 | [diff] [blame] | 56 | "CHIP_CONFIG_PERSIST_SUBSCRIPTIONS=${chip_persist_subscriptions}", |
Jeff Tung | c1ec2d7 | 2023-07-22 10:33:06 -0700 | [diff] [blame] | 57 | "CHIP_CONFIG_SUBSCRIPTION_TIMEOUT_RESUMPTION=${chip_subscription_timeout_resumption}", |
Evgeny Margolis | b89e83b | 2023-02-24 18:20:02 -1000 | [diff] [blame] | 58 | "CHIP_CONFIG_ENABLE_EVENTLIST_ATTRIBUTE=${enable_eventlist_attribute}", |
Wang Qixiang | 14bdc24 | 2023-08-04 13:04:55 +0800 | [diff] [blame] | 59 | "CHIP_CONFIG_ENABLE_READ_CLIENT=${chip_enable_read_client}", |
Zang MingJie | 7dede20 | 2022-04-06 11:54:50 +0800 | [diff] [blame] | 60 | ] |
Michael Spang | c6b6fb3 | 2023-11-17 02:21:20 -0500 | [diff] [blame] | 61 | |
| 62 | visibility = [ ":app_config" ] |
Michael Spang | efa630b | 2020-07-08 22:23:08 -0400 | [diff] [blame] | 63 | } |
| 64 | |
mkardous-silabs | b8db5ee | 2024-01-25 15:05:17 -0500 | [diff] [blame] | 65 | source_set("app_config") { |
| 66 | sources = [ "AppConfig.h" ] |
| 67 | |
| 68 | deps = [ ":app_buildconfig" ] |
| 69 | } |
| 70 | |
Terence Hampson | 4460db1 | 2023-11-15 11:21:03 -0500 | [diff] [blame] | 71 | source_set("revision_info") { |
| 72 | sources = [ |
| 73 | "DataModelRevision.h", |
| 74 | "InteractionModelRevision.h", |
| 75 | "SpecificationVersion.h", |
| 76 | ] |
| 77 | } |
| 78 | |
mkardous-silabs | b8db5ee | 2024-01-25 15:05:17 -0500 | [diff] [blame] | 79 | source_set("paths") { |
| 80 | sources = [ |
| 81 | "AttributePathParams.h", |
| 82 | "ConcreteClusterPath.h", |
| 83 | "ConcreteEventPath.h", |
| 84 | "DataVersionFilter.h", |
| 85 | "EventPathParams.h", |
| 86 | ] |
Daniel Nicoara | 641e3ad | 2022-07-25 15:32:03 -0400 | [diff] [blame] | 87 | |
mkardous-silabs | b8db5ee | 2024-01-25 15:05:17 -0500 | [diff] [blame] | 88 | # This source sets also depends on basic-types.h that is not in any dependency we can use |
| 89 | public_deps = [ |
| 90 | ":app_config", |
| 91 | "${chip_root}/src/lib/core", |
Andrei Litvin | b389c60 | 2024-02-01 00:25:59 -0500 | [diff] [blame] | 92 | "${chip_root}/src/lib/core:types", |
mkardous-silabs | b8db5ee | 2024-01-25 15:05:17 -0500 | [diff] [blame] | 93 | ] |
Daniel Nicoara | 641e3ad | 2022-07-25 15:32:03 -0400 | [diff] [blame] | 94 | } |
| 95 | |
mkardous-silabs | b8db5ee | 2024-01-25 15:05:17 -0500 | [diff] [blame] | 96 | source_set("global-attributes") { |
| 97 | sources = [ "GlobalAttributes.h" ] |
Michael Spang | efa630b | 2020-07-08 22:23:08 -0400 | [diff] [blame] | 98 | |
Andrei Litvin | cfd1551 | 2024-02-01 03:57:55 -0500 | [diff] [blame] | 99 | # This also depends on zap-generated code which is currently impossible to split out |
| 100 | # as a dependency |
| 101 | public_deps = [ |
| 102 | ":app_config", |
| 103 | "${chip_root}/src/lib/support", |
| 104 | ] |
mkardous-silabs | b8db5ee | 2024-01-25 15:05:17 -0500 | [diff] [blame] | 105 | } |
| 106 | |
mkardous-silabs | d61bfd6 | 2024-01-30 17:50:01 -0500 | [diff] [blame] | 107 | source_set("subscription-manager") { |
mkardous-silabs | 9526318 | 2024-01-31 23:17:45 -0500 | [diff] [blame] | 108 | sources = [ "SubscriptionsInfoProvider.h" ] |
mkardous-silabs | d61bfd6 | 2024-01-30 17:50:01 -0500 | [diff] [blame] | 109 | |
| 110 | public_deps = [ "${chip_root}/src/lib/core" ] |
| 111 | } |
| 112 | |
mkardous-silabs | b8db5ee | 2024-01-25 15:05:17 -0500 | [diff] [blame] | 113 | config("config-controller-dynamic-server") { |
| 114 | defines = [ |
| 115 | "CHIP_CONFIG_SKIP_APP_SPECIFIC_GENERATED_HEADER_INCLUDES=1", |
| 116 | "CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT=1", |
| 117 | ] |
| 118 | } |
| 119 | |
| 120 | # interaction-model is a static-library because it currently requires global functions (app/util/...) that are stubbed in different test files that depend on the app static_library |
| 121 | # which in tern depens on the interaction-model. |
| 122 | # Using source_set prevents the unit test to build correctly. |
| 123 | static_library("interaction-model") { |
| 124 | sources = [ |
| 125 | "CASEClient.cpp", |
| 126 | "CASEClient.h", |
| 127 | "CASEClientPool.h", |
| 128 | "CASESessionManager.cpp", |
| 129 | "CASESessionManager.h", |
| 130 | "DeviceProxy.cpp", |
| 131 | "DeviceProxy.h", |
| 132 | "InteractionModelEngine.cpp", |
| 133 | "InteractionModelEngine.h", |
| 134 | "InteractionModelTimeout.h", |
Terence Hampson | b6859d7 | 2022-08-05 13:48:11 -0400 | [diff] [blame] | 135 | "OperationalSessionSetup.cpp", |
| 136 | "OperationalSessionSetup.h", |
| 137 | "OperationalSessionSetupPool.h", |
Marc Lepage | 2c4de1b | 2022-01-27 13:25:46 -0500 | [diff] [blame] | 138 | "RequiredPrivilege.cpp", |
| 139 | "RequiredPrivilege.h", |
yunhanw-google | b5dbad1 | 2021-11-16 16:46:37 -0800 | [diff] [blame] | 140 | "StatusResponse.cpp", |
| 141 | "StatusResponse.h", |
Jeff Tung | 37919a1 | 2023-01-20 17:58:51 -0800 | [diff] [blame] | 142 | "SubscriptionResumptionStorage.h", |
Boris Zbarsky | ffee2a9 | 2021-12-01 14:34:57 -0500 | [diff] [blame] | 143 | "TimedHandler.cpp", |
| 144 | "TimedHandler.h", |
yunhanw-google | dedd3d0 | 2021-04-08 05:51:34 -0700 | [diff] [blame] | 145 | "reporting/Engine.cpp", |
Michael Spang | a08f826 | 2021-04-23 18:06:20 -0400 | [diff] [blame] | 146 | "reporting/Engine.h", |
lpbeliveau-silabs | edbdf8a | 2023-07-13 12:20:44 -0400 | [diff] [blame] | 147 | "reporting/ReportScheduler.h", |
| 148 | "reporting/ReportSchedulerImpl.cpp", |
| 149 | "reporting/ReportSchedulerImpl.h", |
lpbeliveau-silabs | d44f789 | 2023-07-19 18:17:12 -0400 | [diff] [blame] | 150 | "reporting/SynchronizedReportSchedulerImpl.cpp", |
| 151 | "reporting/SynchronizedReportSchedulerImpl.h", |
Boris Zbarsky | 95d337c | 2022-11-18 01:30:16 -0500 | [diff] [blame] | 152 | "reporting/reporting.h", |
Michael Spang | efa630b | 2020-07-08 22:23:08 -0400 | [diff] [blame] | 153 | ] |
| 154 | |
mkardous-silabs | b8db5ee | 2024-01-25 15:05:17 -0500 | [diff] [blame] | 155 | public_deps = [ |
| 156 | ":app_config", |
mkardous-silabs | b8db5ee | 2024-01-25 15:05:17 -0500 | [diff] [blame] | 157 | ":paths", |
mkardous-silabs | d61bfd6 | 2024-01-30 17:50:01 -0500 | [diff] [blame] | 158 | ":subscription-manager", |
Andrei Litvin | 0ba1b7c | 2024-02-06 21:16:00 -0500 | [diff] [blame] | 159 | "${chip_root}/src/app/MessageDef", |
mkardous-silabs | 5f955f4 | 2024-01-30 20:52:28 -0500 | [diff] [blame] | 160 | "${chip_root}/src/app/icd/server:icd-server-config", |
| 161 | "${chip_root}/src/app/icd/server:observer", |
mkardous-silabs | b8db5ee | 2024-01-25 15:05:17 -0500 | [diff] [blame] | 162 | "${chip_root}/src/lib/address_resolve", |
| 163 | "${chip_root}/src/lib/support", |
| 164 | "${chip_root}/src/protocols/interaction_model", |
| 165 | "${chip_root}/src/protocols/secure_channel", |
| 166 | "${chip_root}/src/system", |
| 167 | ] |
| 168 | |
| 169 | public_configs = [ "${chip_root}/src:includes" ] |
| 170 | |
Jeff Tung | 19cb1a5 | 2023-01-26 05:56:05 -0800 | [diff] [blame] | 171 | if (chip_persist_subscriptions) { |
| 172 | sources += [ |
| 173 | "SimpleSubscriptionResumptionStorage.cpp", |
| 174 | "SimpleSubscriptionResumptionStorage.h", |
mkardous-silabs | b8db5ee | 2024-01-25 15:05:17 -0500 | [diff] [blame] | 175 | "SubscriptionResumptionSessionEstablisher.cpp", |
| 176 | "SubscriptionResumptionSessionEstablisher.h", |
Jeff Tung | 19cb1a5 | 2023-01-26 05:56:05 -0800 | [diff] [blame] | 177 | ] |
| 178 | } |
| 179 | |
yunhanw-google | 6e3d045 | 2023-09-15 19:32:28 -0700 | [diff] [blame] | 180 | if (chip_build_controller_dynamic_server) { |
yunhanw-google | 6e3d045 | 2023-09-15 19:32:28 -0700 | [diff] [blame] | 181 | sources += [ |
| 182 | "clusters/ota-provider/ota-provider.cpp", |
| 183 | "dynamic_server/AccessControl.cpp", |
| 184 | "dynamic_server/AccessControl.h", |
| 185 | "dynamic_server/DynamicDispatcher.cpp", |
| 186 | "util/privilege-storage.cpp", |
| 187 | "util/privilege-storage.h", |
| 188 | ] |
yunhanw-google | 6e3d045 | 2023-09-15 19:32:28 -0700 | [diff] [blame] | 189 | |
mkardous-silabs | b8db5ee | 2024-01-25 15:05:17 -0500 | [diff] [blame] | 190 | public_deps += [ |
| 191 | ":global-attributes", |
| 192 | "${chip_root}/src/access", |
Wang Qixiang | 371756b | 2024-01-05 04:46:39 +0800 | [diff] [blame] | 193 | ] |
mkardous-silabs | b8db5ee | 2024-01-25 15:05:17 -0500 | [diff] [blame] | 194 | |
| 195 | public_configs += [ ":config-controller-dynamic-server" ] |
Wang Qixiang | 371756b | 2024-01-05 04:46:39 +0800 | [diff] [blame] | 196 | } |
mkardous-silabs | b8db5ee | 2024-01-25 15:05:17 -0500 | [diff] [blame] | 197 | } |
| 198 | |
| 199 | # Note to developpers, instead of continuously adding files in the app librabry, it is recommand to create smaller source_sets that app can depend on. |
| 200 | # This way, we can have a better understanding of dependencies and other componenets can depend on the different source_sets without needing to depend on the entire app library. |
| 201 | static_library("app") { |
| 202 | output_name = "libCHIPDataModel" |
| 203 | |
| 204 | sources = [ |
| 205 | "AttributeAccessInterface.cpp", |
| 206 | "AttributePathExpandIterator.cpp", |
| 207 | "AttributePathExpandIterator.h", |
| 208 | "AttributePersistenceProvider.h", |
| 209 | "ChunkedWriteCallback.cpp", |
| 210 | "ChunkedWriteCallback.h", |
| 211 | "CommandHandler.cpp", |
| 212 | "CommandResponseHelper.h", |
| 213 | "CommandResponseSender.cpp", |
| 214 | "CommandSender.cpp", |
| 215 | "DefaultAttributePersistenceProvider.cpp", |
| 216 | "DefaultAttributePersistenceProvider.h", |
| 217 | "DeferredAttributePersistenceProvider.cpp", |
| 218 | "DeferredAttributePersistenceProvider.h", |
| 219 | "EventManagement.cpp", |
| 220 | "FailSafeContext.cpp", |
| 221 | "FailSafeContext.h", |
| 222 | "OTAUserConsentCommon.h", |
| 223 | "ReadHandler.cpp", |
| 224 | "SafeAttributePersistenceProvider.h", |
| 225 | "TimedRequest.cpp", |
| 226 | "TimedRequest.h", |
| 227 | "TimerDelegates.cpp", |
| 228 | "TimerDelegates.h", |
| 229 | "WriteClient.cpp", |
| 230 | "WriteHandler.cpp", |
| 231 | ] |
| 232 | |
| 233 | public_deps = [ |
| 234 | ":app_config", |
| 235 | ":global-attributes", |
| 236 | ":interaction-model", |
mkardous-silabs | b8db5ee | 2024-01-25 15:05:17 -0500 | [diff] [blame] | 237 | ":revision_info", |
Andrei Litvin | aa67fba | 2024-02-01 12:55:50 -0500 | [diff] [blame] | 238 | "${chip_root}/src/app/data-model", |
mkardous-silabs | 5f955f4 | 2024-01-30 20:52:28 -0500 | [diff] [blame] | 239 | "${chip_root}/src/app/icd/server:icd-server-config", |
mkardous-silabs | b8db5ee | 2024-01-25 15:05:17 -0500 | [diff] [blame] | 240 | "${chip_root}/src/lib/address_resolve", |
| 241 | "${chip_root}/src/lib/support", |
| 242 | "${chip_root}/src/messaging", |
| 243 | "${chip_root}/src/protocols/interaction_model", |
| 244 | "${chip_root}/src/system", |
mkardous-silabs | b8db5ee | 2024-01-25 15:05:17 -0500 | [diff] [blame] | 245 | ] |
Wang Qixiang | 371756b | 2024-01-05 04:46:39 +0800 | [diff] [blame] | 246 | |
Wang Qixiang | 14bdc24 | 2023-08-04 13:04:55 +0800 | [diff] [blame] | 247 | if (chip_enable_read_client) { |
| 248 | sources += [ |
| 249 | "BufferedReadCallback.cpp", |
| 250 | "ClusterStateCache.cpp", |
| 251 | "ClusterStateCache.h", |
| 252 | "ReadClient.cpp", |
| 253 | ] |
| 254 | } |
| 255 | |
mkardous-silabs | 9828293 | 2023-06-05 14:13:46 -0400 | [diff] [blame] | 256 | if (chip_enable_icd_server) { |
mkardous-silabs | a9d5b1a | 2023-11-28 12:50:44 -0500 | [diff] [blame] | 257 | public_deps += [ |
mkardous-silabs | 5f955f4 | 2024-01-30 20:52:28 -0500 | [diff] [blame] | 258 | "${chip_root}/src/app/icd/server:manager", |
| 259 | "${chip_root}/src/app/icd/server:notifier", |
mkardous-silabs | a9d5b1a | 2023-11-28 12:50:44 -0500 | [diff] [blame] | 260 | ] |
mkardous-silabs | 9828293 | 2023-06-05 14:13:46 -0400 | [diff] [blame] | 261 | } |
| 262 | |
Boris Zbarsky | 46c7830 | 2020-09-24 15:57:57 -0400 | [diff] [blame] | 263 | cflags = [ "-Wconversion" ] |
| 264 | |
Michael Spang | e00eac3 | 2021-06-21 17:25:47 -0400 | [diff] [blame] | 265 | public_configs = [ "${chip_root}/src:includes" ] |
Michael Spang | efa630b | 2020-07-08 22:23:08 -0400 | [diff] [blame] | 266 | } |