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") |
Boris Zbarsky | 5d66326 | 2020-08-27 18:12:39 -0400 | [diff] [blame] | 16 | import("//build_overrides/nlio.gni") |
Jeff Tung | 19cb1a5 | 2023-01-26 05:56:05 -0800 | [diff] [blame] | 17 | import("${chip_root}/src/platform/device.gni") |
Michael Spang | e00eac3 | 2021-06-21 17:25:47 -0400 | [diff] [blame] | 18 | |
| 19 | import("${chip_root}/build/chip/buildconfig_header.gni") |
Song Guo | a77a662 | 2021-01-29 13:13:02 +0800 | [diff] [blame] | 20 | import("common_flags.gni") |
mkardous-silabs | 9828293 | 2023-06-05 14:13:46 -0400 | [diff] [blame] | 21 | import("icd/icd.gni") |
Michael Spang | efa630b | 2020-07-08 22:23:08 -0400 | [diff] [blame] | 22 | |
yunhanw-google | d644bb0 | 2021-04-13 07:26:17 -0700 | [diff] [blame] | 23 | declare_args() { |
| 24 | # Enable strict schema checks. |
yunhanw-google | 751d0dd | 2022-11-16 19:09:58 -0800 | [diff] [blame] | 25 | enable_im_pretty_print = |
Boris Zbarsky | c17d723 | 2022-09-09 12:56:27 -0400 | [diff] [blame] | 26 | is_debug && (current_os == "linux" || current_os == "mac" || |
| 27 | current_os == "ios" || current_os == "android") |
Tennessee Carmel-Veilleux | 085acd0 | 2022-04-13 23:42:22 -0400 | [diff] [blame] | 28 | |
| 29 | # Logging verbosity control for Access Control implementation |
| 30 | # |
| 31 | # If set to > 0, it is desired to get additional logging on all |
| 32 | # access control checks for better debugging ability. |
| 33 | # |
| 34 | # If set to > 1, it is desired to log every single check |
| 35 | chip_access_control_policy_logging_verbosity = 0 |
| 36 | if (is_debug && (current_os == "linux" || current_os == "mac")) { |
| 37 | chip_access_control_policy_logging_verbosity = 2 |
| 38 | } |
| 39 | |
Zang MingJie | 7dede20 | 2022-04-06 11:54:50 +0800 | [diff] [blame] | 40 | chip_enable_session_resumption = true |
Song GUO | 077e44e | 2022-04-25 10:16:30 +0800 | [diff] [blame] | 41 | |
| 42 | # 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. |
| 43 | chip_im_force_fabric_quota_check = false |
Evgeny Margolis | b89e83b | 2023-02-24 18:20:02 -1000 | [diff] [blame] | 44 | |
manjunath-grl | d9e0c3f | 2023-05-18 18:33:15 +0530 | [diff] [blame] | 45 | enable_eventlist_attribute = true |
yunhanw-google | d644bb0 | 2021-04-13 07:26:17 -0700 | [diff] [blame] | 46 | } |
| 47 | |
Michael Spang | e00eac3 | 2021-06-21 17:25:47 -0400 | [diff] [blame] | 48 | buildconfig_header("app_buildconfig") { |
| 49 | header = "AppBuildConfig.h" |
| 50 | header_dir = "app" |
| 51 | |
Zang MingJie | 7dede20 | 2022-04-06 11:54:50 +0800 | [diff] [blame] | 52 | defines = [ |
yunhanw-google | 751d0dd | 2022-11-16 19:09:58 -0800 | [diff] [blame] | 53 | "CHIP_CONFIG_IM_PRETTY_PRINT=${enable_im_pretty_print}", |
Song GUO | 077e44e | 2022-04-25 10:16:30 +0800 | [diff] [blame] | 54 | "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] | 55 | "CHIP_CONFIG_ENABLE_SESSION_RESUMPTION=${chip_enable_session_resumption}", |
Tennessee Carmel-Veilleux | 085acd0 | 2022-04-13 23:42:22 -0400 | [diff] [blame] | 56 | "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] | 57 | "CHIP_CONFIG_PERSIST_SUBSCRIPTIONS=${chip_persist_subscriptions}", |
Evgeny Margolis | b89e83b | 2023-02-24 18:20:02 -1000 | [diff] [blame] | 58 | "CHIP_CONFIG_ENABLE_EVENTLIST_ATTRIBUTE=${enable_eventlist_attribute}", |
Zang MingJie | 7dede20 | 2022-04-06 11:54:50 +0800 | [diff] [blame] | 59 | ] |
Michael Spang | efa630b | 2020-07-08 22:23:08 -0400 | [diff] [blame] | 60 | } |
| 61 | |
Daniel Nicoara | 641e3ad | 2022-07-25 15:32:03 -0400 | [diff] [blame] | 62 | source_set("app_config") { |
| 63 | sources = [ "AppConfig.h" ] |
| 64 | |
| 65 | public_deps = [ ":app_buildconfig" ] |
| 66 | } |
| 67 | |
Rob Walker | b14e3e3 | 2020-08-20 13:59:22 -0700 | [diff] [blame] | 68 | static_library("app") { |
| 69 | output_name = "libCHIPDataModel" |
Michael Spang | efa630b | 2020-07-08 22:23:08 -0400 | [diff] [blame] | 70 | |
| 71 | sources = [ |
Song GUO | bfdbd45 | 2021-12-06 15:53:34 +0800 | [diff] [blame] | 72 | "AttributeAccessInterface.cpp", |
Song GUO | 09736d3 | 2021-11-12 21:57:10 +0800 | [diff] [blame] | 73 | "AttributePathExpandIterator.cpp", |
| 74 | "AttributePathExpandIterator.h", |
Song GUO | 09736d3 | 2021-11-12 21:57:10 +0800 | [diff] [blame] | 75 | "AttributePathParams.h", |
Boris Zbarsky | ec71346 | 2022-01-06 15:53:22 -0500 | [diff] [blame] | 76 | "AttributePersistenceProvider.h", |
Jerry Johns | 55349a5 | 2021-11-20 01:33:41 -0800 | [diff] [blame] | 77 | "BufferedReadCallback.cpp", |
Jiacheng Guo | aba3c81 | 2021-12-09 02:18:03 +0800 | [diff] [blame] | 78 | "CASEClient.cpp", |
| 79 | "CASEClient.h", |
| 80 | "CASEClientPool.h", |
Pankaj Garg | eb84a9d | 2021-11-16 13:59:57 -0800 | [diff] [blame] | 81 | "CASESessionManager.cpp", |
| 82 | "CASESessionManager.h", |
Song GUO | 56634bf | 2022-02-10 09:08:23 +0800 | [diff] [blame] | 83 | "ChunkedWriteCallback.cpp", |
| 84 | "ChunkedWriteCallback.h", |
Jerry Johns | 964adbc | 2022-04-14 16:42:04 -0700 | [diff] [blame] | 85 | "ClusterStateCache.cpp", |
| 86 | "ClusterStateCache.h", |
yunhanw-google | e430b1d | 2021-01-06 06:12:46 -0800 | [diff] [blame] | 87 | "CommandHandler.cpp", |
Hui.Li-TCL | 20dea72 | 2022-01-12 07:22:47 +0800 | [diff] [blame] | 88 | "CommandResponseHelper.h", |
yunhanw-google | e430b1d | 2021-01-06 06:12:46 -0800 | [diff] [blame] | 89 | "CommandSender.cpp", |
Boris Zbarsky | ec71346 | 2022-01-06 15:53:22 -0500 | [diff] [blame] | 90 | "DefaultAttributePersistenceProvider.cpp", |
Damian Królik | 1ee863e | 2022-11-05 15:51:18 +0100 | [diff] [blame] | 91 | "DeferredAttributePersistenceProvider.cpp", |
Pankaj Garg | a04576d | 2021-11-08 15:04:13 -0800 | [diff] [blame] | 92 | "DeviceProxy.cpp", |
| 93 | "DeviceProxy.h", |
yunhanw-google | ef040a7 | 2021-05-05 07:17:56 -0700 | [diff] [blame] | 94 | "EventManagement.cpp", |
yunhanw-google | c79b67b | 2021-11-24 20:58:19 -0800 | [diff] [blame] | 95 | "EventPathParams.h", |
Tennessee Carmel-Veilleux | b91727b | 2022-06-28 20:52:02 -0400 | [diff] [blame] | 96 | "FailSafeContext.cpp", |
| 97 | "FailSafeContext.h", |
Boris Zbarsky | e76c227 | 2022-02-14 21:56:25 -0500 | [diff] [blame] | 98 | "GlobalAttributes.h", |
yunhanw-google | e430b1d | 2021-01-06 06:12:46 -0800 | [diff] [blame] | 99 | "InteractionModelEngine.cpp", |
yunhanw-google | 86b7b7f | 2022-01-28 16:53:51 -0800 | [diff] [blame] | 100 | "InteractionModelRevision.h", |
Boris Zbarsky | 0a6a012 | 2022-02-01 08:50:23 -0500 | [diff] [blame] | 101 | "InteractionModelTimeout.h", |
yunhanw-google | 7898b53 | 2021-11-01 09:52:46 -0700 | [diff] [blame] | 102 | "MessageDef/ArrayBuilder.cpp", |
| 103 | "MessageDef/ArrayParser.cpp", |
yunhanw-google | b717b36 | 2021-11-08 13:34:19 -0800 | [diff] [blame] | 104 | "MessageDef/AttributeDataIB.cpp", |
| 105 | "MessageDef/AttributeDataIB.h", |
| 106 | "MessageDef/AttributeDataIBs.cpp", |
| 107 | "MessageDef/AttributeDataIBs.h", |
yunhanw-google | 64ffda0 | 2021-11-04 18:05:36 -0700 | [diff] [blame] | 108 | "MessageDef/AttributePathIB.cpp", |
| 109 | "MessageDef/AttributePathIB.h", |
yunhanw-google | b717b36 | 2021-11-08 13:34:19 -0800 | [diff] [blame] | 110 | "MessageDef/AttributePathIBs.cpp", |
| 111 | "MessageDef/AttributePathIBs.h", |
| 112 | "MessageDef/AttributeReportIB.cpp", |
| 113 | "MessageDef/AttributeReportIB.h", |
| 114 | "MessageDef/AttributeReportIBs.cpp", |
| 115 | "MessageDef/AttributeReportIBs.h", |
yunhanw-google | 35e6717 | 2021-10-11 17:12:06 -0700 | [diff] [blame] | 116 | "MessageDef/AttributeStatusIB.cpp", |
| 117 | "MessageDef/AttributeStatusIB.h", |
yunhanw-google | f111727 | 2021-12-02 19:59:44 -0800 | [diff] [blame] | 118 | "MessageDef/AttributeStatusIBs.cpp", |
| 119 | "MessageDef/AttributeStatusIBs.h", |
yunhanw-google | 0c18355 | 2021-01-22 09:12:14 -0800 | [diff] [blame] | 120 | "MessageDef/Builder.cpp", |
| 121 | "MessageDef/Builder.h", |
yunhanw-google | a1cb341 | 2021-12-06 13:32:40 -0800 | [diff] [blame] | 122 | "MessageDef/ClusterPathIB.cpp", |
| 123 | "MessageDef/ClusterPathIB.h", |
yunhanw-google | 67f74a3 | 2021-10-21 12:15:08 -0700 | [diff] [blame] | 124 | "MessageDef/CommandDataIB.cpp", |
yunhanw-google | 8c2638c | 2021-10-20 16:33:42 -0700 | [diff] [blame] | 125 | "MessageDef/CommandPathIB.cpp", |
yunhanw-google | 36e61e3 | 2021-11-02 08:31:34 -0700 | [diff] [blame] | 126 | "MessageDef/CommandStatusIB.cpp", |
yunhanw-google | a1cb341 | 2021-12-06 13:32:40 -0800 | [diff] [blame] | 127 | "MessageDef/DataVersionFilterIB.cpp", |
| 128 | "MessageDef/DataVersionFilterIB.h", |
| 129 | "MessageDef/DataVersionFilterIBs.cpp", |
| 130 | "MessageDef/DataVersionFilterIBs.h", |
yunhanw-google | 3bec0f9 | 2021-11-03 16:12:39 -0700 | [diff] [blame] | 131 | "MessageDef/EventDataIB.cpp", |
| 132 | "MessageDef/EventDataIB.h", |
yunhanw-google | bf585f8 | 2021-10-29 19:20:07 -0700 | [diff] [blame] | 133 | "MessageDef/EventFilterIB.cpp", |
yunhanw-google | f111727 | 2021-12-02 19:59:44 -0800 | [diff] [blame] | 134 | "MessageDef/EventFilterIBs.cpp", |
yunhanw-google | 2fe9024 | 2021-11-01 15:13:44 -0700 | [diff] [blame] | 135 | "MessageDef/EventPathIB.cpp", |
| 136 | "MessageDef/EventPathIB.h", |
yunhanw-google | f111727 | 2021-12-02 19:59:44 -0800 | [diff] [blame] | 137 | "MessageDef/EventPathIBs.cpp", |
| 138 | "MessageDef/EventPathIBs.h", |
yunhanw-google | 3bec0f9 | 2021-11-03 16:12:39 -0700 | [diff] [blame] | 139 | "MessageDef/EventReportIB.cpp", |
| 140 | "MessageDef/EventReportIB.h", |
yunhanw-google | f111727 | 2021-12-02 19:59:44 -0800 | [diff] [blame] | 141 | "MessageDef/EventReportIBs.cpp", |
| 142 | "MessageDef/EventReportIBs.h", |
yunhanw-google | 1f6c6e6 | 2021-11-02 10:09:53 -0700 | [diff] [blame] | 143 | "MessageDef/EventStatusIB.cpp", |
| 144 | "MessageDef/EventStatusIB.h", |
yunhanw-google | 36e61e3 | 2021-11-02 08:31:34 -0700 | [diff] [blame] | 145 | "MessageDef/InvokeRequestMessage.cpp", |
| 146 | "MessageDef/InvokeRequests.cpp", |
| 147 | "MessageDef/InvokeResponseIB.cpp", |
yunhanw-google | f111727 | 2021-12-02 19:59:44 -0800 | [diff] [blame] | 148 | "MessageDef/InvokeResponseIBs.cpp", |
yunhanw-google | 36e61e3 | 2021-11-02 08:31:34 -0700 | [diff] [blame] | 149 | "MessageDef/InvokeResponseMessage.cpp", |
yunhanw-google | 0c18355 | 2021-01-22 09:12:14 -0800 | [diff] [blame] | 150 | "MessageDef/ListBuilder.cpp", |
yunhanw-google | 0c18355 | 2021-01-22 09:12:14 -0800 | [diff] [blame] | 151 | "MessageDef/ListParser.cpp", |
yunhanw-google | 86b7b7f | 2022-01-28 16:53:51 -0800 | [diff] [blame] | 152 | "MessageDef/MessageBuilder.cpp", |
| 153 | "MessageDef/MessageBuilder.h", |
yunhanw-google | e4c0115 | 2021-04-16 08:22:10 -0700 | [diff] [blame] | 154 | "MessageDef/MessageDefHelper.cpp", |
yunhanw-google | 0c18355 | 2021-01-22 09:12:14 -0800 | [diff] [blame] | 155 | "MessageDef/MessageDefHelper.h", |
yunhanw-google | 86b7b7f | 2022-01-28 16:53:51 -0800 | [diff] [blame] | 156 | "MessageDef/MessageParser.cpp", |
| 157 | "MessageDef/MessageParser.h", |
yunhanw-google | 0c18355 | 2021-01-22 09:12:14 -0800 | [diff] [blame] | 158 | "MessageDef/Parser.cpp", |
| 159 | "MessageDef/Parser.h", |
yunhanw-google | 12ec702 | 2021-11-01 19:53:29 -0700 | [diff] [blame] | 160 | "MessageDef/ReadRequestMessage.cpp", |
| 161 | "MessageDef/ReadRequestMessage.h", |
| 162 | "MessageDef/ReportDataMessage.cpp", |
| 163 | "MessageDef/ReportDataMessage.h", |
yunhanw-google | 35e6717 | 2021-10-11 17:12:06 -0700 | [diff] [blame] | 164 | "MessageDef/StatusIB.cpp", |
| 165 | "MessageDef/StatusIB.h", |
yunhanw-google | 12ec702 | 2021-11-01 19:53:29 -0700 | [diff] [blame] | 166 | "MessageDef/StatusResponseMessage.cpp", |
yunhanw-google | 7898b53 | 2021-11-01 09:52:46 -0700 | [diff] [blame] | 167 | "MessageDef/StructBuilder.cpp", |
| 168 | "MessageDef/StructParser.cpp", |
yunhanw-google | 12ec702 | 2021-11-01 19:53:29 -0700 | [diff] [blame] | 169 | "MessageDef/SubscribeRequestMessage.cpp", |
| 170 | "MessageDef/SubscribeResponseMessage.cpp", |
yunhanw-google | 7f05fb6 | 2021-10-29 06:55:58 -0700 | [diff] [blame] | 171 | "MessageDef/TimedRequestMessage.cpp", |
yunhanw-google | 12ec702 | 2021-11-01 19:53:29 -0700 | [diff] [blame] | 172 | "MessageDef/WriteRequestMessage.cpp", |
| 173 | "MessageDef/WriteResponseMessage.cpp", |
Shubham Patil | 47cf069 | 2022-03-31 08:49:01 +0530 | [diff] [blame] | 174 | "OTAUserConsentCommon.h", |
Terence Hampson | b6859d7 | 2022-08-05 13:48:11 -0400 | [diff] [blame] | 175 | "OperationalSessionSetup.cpp", |
| 176 | "OperationalSessionSetup.h", |
| 177 | "OperationalSessionSetupPool.h", |
yunhanw-google | 0856624 | 2021-03-18 15:29:39 -0700 | [diff] [blame] | 178 | "ReadClient.cpp", |
| 179 | "ReadHandler.cpp", |
Marc Lepage | 2c4de1b | 2022-01-27 13:25:46 -0500 | [diff] [blame] | 180 | "RequiredPrivilege.cpp", |
| 181 | "RequiredPrivilege.h", |
yunhanw-google | b5dbad1 | 2021-11-16 16:46:37 -0800 | [diff] [blame] | 182 | "StatusResponse.cpp", |
| 183 | "StatusResponse.h", |
Jeff Tung | 37919a1 | 2023-01-20 17:58:51 -0800 | [diff] [blame] | 184 | "SubscriptionResumptionStorage.h", |
Boris Zbarsky | ffee2a9 | 2021-12-01 14:34:57 -0500 | [diff] [blame] | 185 | "TimedHandler.cpp", |
| 186 | "TimedHandler.h", |
Boris Zbarsky | 3397fdc | 2021-12-06 14:01:12 -0500 | [diff] [blame] | 187 | "TimedRequest.cpp", |
| 188 | "TimedRequest.h", |
yunhanw-google | 6c044e5 | 2021-06-18 13:01:52 -0700 | [diff] [blame] | 189 | "WriteClient.cpp", |
| 190 | "WriteHandler.cpp", |
yunhanw-google | dedd3d0 | 2021-04-08 05:51:34 -0700 | [diff] [blame] | 191 | "reporting/Engine.cpp", |
Michael Spang | a08f826 | 2021-04-23 18:06:20 -0400 | [diff] [blame] | 192 | "reporting/Engine.h", |
Boris Zbarsky | 95d337c | 2022-11-18 01:30:16 -0500 | [diff] [blame] | 193 | "reporting/reporting.h", |
Michael Spang | efa630b | 2020-07-08 22:23:08 -0400 | [diff] [blame] | 194 | ] |
| 195 | |
Jeff Tung | 19cb1a5 | 2023-01-26 05:56:05 -0800 | [diff] [blame] | 196 | if (chip_persist_subscriptions) { |
| 197 | sources += [ |
| 198 | "SimpleSubscriptionResumptionStorage.cpp", |
| 199 | "SimpleSubscriptionResumptionStorage.h", |
| 200 | ] |
| 201 | } |
| 202 | |
Michael Spang | efa630b | 2020-07-08 22:23:08 -0400 | [diff] [blame] | 203 | public_deps = [ |
Daniel Nicoara | 641e3ad | 2022-07-25 15:32:03 -0400 | [diff] [blame] | 204 | ":app_config", |
Marc Lepage | 7871953 | 2021-12-06 23:01:50 -0500 | [diff] [blame] | 205 | "${chip_root}/src/access", |
Andrei Litvin | 5a28865 | 2022-03-11 16:23:36 -0500 | [diff] [blame] | 206 | "${chip_root}/src/lib/address_resolve", |
Michael Spang | efa630b | 2020-07-08 22:23:08 -0400 | [diff] [blame] | 207 | "${chip_root}/src/lib/support", |
yunhanw-google | e430b1d | 2021-01-06 06:12:46 -0800 | [diff] [blame] | 208 | "${chip_root}/src/messaging", |
yunhanw-google | 9c056ef | 2021-08-25 16:11:21 -0700 | [diff] [blame] | 209 | "${chip_root}/src/protocols/secure_channel", |
Michael Spang | efa630b | 2020-07-08 22:23:08 -0400 | [diff] [blame] | 210 | "${chip_root}/src/system", |
Boris Zbarsky | 5d66326 | 2020-08-27 18:12:39 -0400 | [diff] [blame] | 211 | "${nlio_root}:nlio", |
Michael Spang | efa630b | 2020-07-08 22:23:08 -0400 | [diff] [blame] | 212 | ] |
| 213 | |
mkardous-silabs | 9828293 | 2023-06-05 14:13:46 -0400 | [diff] [blame] | 214 | if (chip_enable_icd_server) { |
| 215 | public_deps += [ "${chip_root}/src/app/icd:server-srcs" ] |
| 216 | } |
| 217 | |
Boris Zbarsky | 46c7830 | 2020-09-24 15:57:57 -0400 | [diff] [blame] | 218 | cflags = [ "-Wconversion" ] |
| 219 | |
Michael Spang | e00eac3 | 2021-06-21 17:25:47 -0400 | [diff] [blame] | 220 | public_configs = [ "${chip_root}/src:includes" ] |
Michael Spang | efa630b | 2020-07-08 22:23:08 -0400 | [diff] [blame] | 221 | } |