| # Copyright (c) 2020 Project CHIP Authors |
| # |
| # Licensed under the Apache License, Version 2.0 (the "License"); |
| # you may not use this file except in compliance with the License. |
| # You may obtain a copy of the License at |
| # |
| # http://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, software |
| # distributed under the License is distributed on an "AS IS" BASIS, |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| # See the License for the specific language governing permissions and |
| # limitations under the License. |
| |
| import("//build_overrides/chip.gni") |
| import("//build_overrides/nlio.gni") |
| import("${chip_root}/build/chip/buildconfig_header.gni") |
| import("${chip_root}/src/platform/device.gni") |
| import("common_flags.gni") |
| import("icd/icd.gni") |
| |
| declare_args() { |
| # Enable strict schema checks. |
| enable_im_pretty_print = |
| is_debug && (current_os == "linux" || current_os == "mac" || |
| current_os == "ios" || current_os == "android") |
| |
| # Logging verbosity control for Access Control implementation |
| # |
| # If set to > 0, it is desired to get additional logging on all |
| # access control checks for better debugging ability. |
| # |
| # If set to > 1, it is desired to log every single check |
| chip_access_control_policy_logging_verbosity = 0 |
| if (is_debug && (current_os == "linux" || current_os == "mac")) { |
| chip_access_control_policy_logging_verbosity = 2 |
| } |
| |
| chip_enable_session_resumption = true |
| |
| # 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. |
| chip_im_force_fabric_quota_check = false |
| |
| enable_eventlist_attribute = false |
| } |
| |
| buildconfig_header("app_buildconfig") { |
| header = "AppBuildConfig.h" |
| header_dir = "app" |
| |
| defines = [ |
| "CHIP_CONFIG_IM_PRETTY_PRINT=${enable_im_pretty_print}", |
| "CHIP_CONFIG_IM_FORCE_FABRIC_QUOTA_CHECK=${chip_im_force_fabric_quota_check}", |
| "CHIP_CONFIG_ENABLE_SESSION_RESUMPTION=${chip_enable_session_resumption}", |
| "CHIP_CONFIG_ACCESS_CONTROL_POLICY_LOGGING_VERBOSITY=${chip_access_control_policy_logging_verbosity}", |
| "CHIP_CONFIG_PERSIST_SUBSCRIPTIONS=${chip_persist_subscriptions}", |
| "CHIP_CONFIG_SUBSCRIPTION_TIMEOUT_RESUMPTION=${chip_subscription_timeout_resumption}", |
| "CHIP_CONFIG_ENABLE_EVENTLIST_ATTRIBUTE=${enable_eventlist_attribute}", |
| "CHIP_CONFIG_ENABLE_ICD_SERVER=${chip_enable_icd_server}", |
| "CHIP_CONFIG_ENABLE_READ_CLIENT=${chip_enable_read_client}", |
| "ICD_REPORT_ON_ENTER_ACTIVE_MODE=${chip_report_on_active_mode}", |
| "ICD_MAX_NOTIFICATION_SUBSCRIBERS=${icd_max_notification_subscribers}", |
| ] |
| } |
| |
| source_set("app_config") { |
| sources = [ "AppConfig.h" ] |
| |
| public_deps = [ ":app_buildconfig" ] |
| } |
| |
| static_library("app") { |
| output_name = "libCHIPDataModel" |
| |
| sources = [ |
| "AttributeAccessInterface.cpp", |
| "AttributePathExpandIterator.cpp", |
| "AttributePathExpandIterator.h", |
| "AttributePathParams.h", |
| "AttributePersistenceProvider.h", |
| "CASEClient.cpp", |
| "CASEClient.h", |
| "CASEClientPool.h", |
| "CASESessionManager.cpp", |
| "CASESessionManager.h", |
| "ChunkedWriteCallback.cpp", |
| "ChunkedWriteCallback.h", |
| "CommandHandler.cpp", |
| "CommandResponseHelper.h", |
| "CommandSender.cpp", |
| "DefaultAttributePersistenceProvider.cpp", |
| "DefaultAttributePersistenceProvider.h", |
| "DeferredAttributePersistenceProvider.cpp", |
| "DeferredAttributePersistenceProvider.h", |
| "DeviceProxy.cpp", |
| "DeviceProxy.h", |
| "EventManagement.cpp", |
| "EventPathParams.h", |
| "FailSafeContext.cpp", |
| "FailSafeContext.h", |
| "GlobalAttributes.h", |
| "InteractionModelEngine.cpp", |
| "InteractionModelRevision.h", |
| "InteractionModelTimeout.h", |
| "MessageDef/ArrayBuilder.cpp", |
| "MessageDef/ArrayParser.cpp", |
| "MessageDef/AttributeDataIB.cpp", |
| "MessageDef/AttributeDataIB.h", |
| "MessageDef/AttributeDataIBs.cpp", |
| "MessageDef/AttributeDataIBs.h", |
| "MessageDef/AttributePathIB.cpp", |
| "MessageDef/AttributePathIB.h", |
| "MessageDef/AttributePathIBs.cpp", |
| "MessageDef/AttributePathIBs.h", |
| "MessageDef/AttributeReportIB.cpp", |
| "MessageDef/AttributeReportIB.h", |
| "MessageDef/AttributeReportIBs.cpp", |
| "MessageDef/AttributeReportIBs.h", |
| "MessageDef/AttributeStatusIB.cpp", |
| "MessageDef/AttributeStatusIB.h", |
| "MessageDef/AttributeStatusIBs.cpp", |
| "MessageDef/AttributeStatusIBs.h", |
| "MessageDef/Builder.cpp", |
| "MessageDef/Builder.h", |
| "MessageDef/ClusterPathIB.cpp", |
| "MessageDef/ClusterPathIB.h", |
| "MessageDef/CommandDataIB.cpp", |
| "MessageDef/CommandPathIB.cpp", |
| "MessageDef/CommandStatusIB.cpp", |
| "MessageDef/DataVersionFilterIB.cpp", |
| "MessageDef/DataVersionFilterIB.h", |
| "MessageDef/DataVersionFilterIBs.cpp", |
| "MessageDef/DataVersionFilterIBs.h", |
| "MessageDef/EventDataIB.cpp", |
| "MessageDef/EventDataIB.h", |
| "MessageDef/EventFilterIB.cpp", |
| "MessageDef/EventFilterIBs.cpp", |
| "MessageDef/EventPathIB.cpp", |
| "MessageDef/EventPathIB.h", |
| "MessageDef/EventPathIBs.cpp", |
| "MessageDef/EventPathIBs.h", |
| "MessageDef/EventReportIB.cpp", |
| "MessageDef/EventReportIB.h", |
| "MessageDef/EventReportIBs.cpp", |
| "MessageDef/EventReportIBs.h", |
| "MessageDef/EventStatusIB.cpp", |
| "MessageDef/EventStatusIB.h", |
| "MessageDef/InvokeRequestMessage.cpp", |
| "MessageDef/InvokeRequests.cpp", |
| "MessageDef/InvokeResponseIB.cpp", |
| "MessageDef/InvokeResponseIBs.cpp", |
| "MessageDef/InvokeResponseMessage.cpp", |
| "MessageDef/ListBuilder.cpp", |
| "MessageDef/ListParser.cpp", |
| "MessageDef/MessageBuilder.cpp", |
| "MessageDef/MessageBuilder.h", |
| "MessageDef/MessageDefHelper.cpp", |
| "MessageDef/MessageDefHelper.h", |
| "MessageDef/MessageParser.cpp", |
| "MessageDef/MessageParser.h", |
| "MessageDef/Parser.cpp", |
| "MessageDef/Parser.h", |
| "MessageDef/ReadRequestMessage.cpp", |
| "MessageDef/ReadRequestMessage.h", |
| "MessageDef/ReportDataMessage.cpp", |
| "MessageDef/ReportDataMessage.h", |
| "MessageDef/StatusIB.cpp", |
| "MessageDef/StatusIB.h", |
| "MessageDef/StatusResponseMessage.cpp", |
| "MessageDef/StructBuilder.cpp", |
| "MessageDef/StructParser.cpp", |
| "MessageDef/SubscribeRequestMessage.cpp", |
| "MessageDef/SubscribeResponseMessage.cpp", |
| "MessageDef/TimedRequestMessage.cpp", |
| "MessageDef/WriteRequestMessage.cpp", |
| "MessageDef/WriteResponseMessage.cpp", |
| "OTAUserConsentCommon.h", |
| "OperationalSessionSetup.cpp", |
| "OperationalSessionSetup.h", |
| "OperationalSessionSetupPool.h", |
| "ReadHandler.cpp", |
| "RequiredPrivilege.cpp", |
| "RequiredPrivilege.h", |
| "SafeAttributePersistenceProvider.h", |
| "StatusResponse.cpp", |
| "StatusResponse.h", |
| "SubscriptionResumptionStorage.h", |
| "TimedHandler.cpp", |
| "TimedHandler.h", |
| "TimedRequest.cpp", |
| "TimedRequest.h", |
| "TimerDelegates.cpp", |
| "TimerDelegates.h", |
| "WriteClient.cpp", |
| "WriteHandler.cpp", |
| "reporting/Engine.cpp", |
| "reporting/Engine.h", |
| "reporting/ReportScheduler.h", |
| "reporting/ReportSchedulerImpl.cpp", |
| "reporting/ReportSchedulerImpl.h", |
| "reporting/SynchronizedReportSchedulerImpl.cpp", |
| "reporting/SynchronizedReportSchedulerImpl.h", |
| "reporting/reporting.h", |
| ] |
| |
| if (chip_persist_subscriptions) { |
| sources += [ |
| "SimpleSubscriptionResumptionStorage.cpp", |
| "SimpleSubscriptionResumptionStorage.h", |
| ] |
| } |
| |
| if (chip_build_controller_dynamic_server) { |
| defines = [ |
| "CHIP_CONFIG_SKIP_APP_SPECIFIC_GENERATED_HEADER_INCLUDES=1", |
| "CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT=1", |
| ] |
| sources += [ |
| "clusters/ota-provider/ota-provider.cpp", |
| "dynamic_server/AccessControl.cpp", |
| "dynamic_server/AccessControl.h", |
| "dynamic_server/DynamicDispatcher.cpp", |
| "util/privilege-storage.cpp", |
| "util/privilege-storage.h", |
| ] |
| } |
| |
| if (chip_enable_read_client) { |
| sources += [ |
| "BufferedReadCallback.cpp", |
| "ClusterStateCache.cpp", |
| "ClusterStateCache.h", |
| "ReadClient.cpp", |
| ] |
| } |
| |
| public_deps = [ |
| ":app_config", |
| "${chip_root}/src/access", |
| "${chip_root}/src/app/icd:notifier", |
| "${chip_root}/src/app/icd:observer-srcs", |
| "${chip_root}/src/lib/address_resolve", |
| "${chip_root}/src/lib/support", |
| "${chip_root}/src/messaging", |
| "${chip_root}/src/protocols/secure_channel", |
| "${chip_root}/src/system", |
| "${nlio_root}:nlio", |
| ] |
| |
| if (chip_enable_icd_server) { |
| public_deps += [ "${chip_root}/src/app/icd:manager-srcs" ] |
| } |
| |
| cflags = [ "-Wconversion" ] |
| |
| public_configs = [ "${chip_root}/src:includes" ] |
| } |