| # Copyright (c) 2021 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/nlassert.gni") |
| |
| import("${chip_root}/build/chip/buildconfig_header.gni") |
| |
| import("${chip_root}/src/platform/device.gni") |
| import("${chip_root}/src/system/system.gni") |
| |
| assert(chip_device_platform == "darwin") |
| |
| declare_args() { |
| dnssd_verbose_context_print = false |
| } |
| |
| buildconfig_header("dnssd_buildconfig") { |
| header = "dnssd_config.h" |
| header_dir = "dnssd" |
| |
| defines = [ "DNSSD_VERBOSE_CONTEXT_PRINT=${dnssd_verbose_context_print}" ] |
| } |
| |
| config("darwin_config") { |
| frameworks = [ |
| "CoreData.framework", |
| "CoreFoundation.framework", |
| "CoreBluetooth.framework", |
| "Foundation.framework", |
| "Network.framework", |
| ] |
| |
| if (current_os == "mac") { |
| frameworks += [ |
| "SystemConfiguration.framework", |
| "CoreWLAN.framework", |
| "IOKit.framework", |
| ] |
| } |
| |
| cflags = [ "-Wconversion" ] |
| } |
| |
| static_library("Darwin") { |
| sources = [ |
| "../DeviceSafeQueue.cpp", |
| "../DeviceSafeQueue.h", |
| "../SingletonConfigurationManager.cpp", |
| "BLEManagerImpl.cpp", |
| "BLEManagerImpl.h", |
| "BlePlatformConfig.h", |
| "CHIPDevicePlatformConfig.h", |
| "CHIPDevicePlatformEvent.h", |
| "CHIPPlatformConfig.h", |
| "ConfigurationManagerImpl.cpp", |
| "ConfigurationManagerImpl.h", |
| "ConnectivityManagerImpl.cpp", |
| "ConnectivityManagerImpl.h", |
| "DiagnosticDataProviderImpl.cpp", |
| "DiagnosticDataProviderImpl.h", |
| "InetPlatformConfig.h", |
| "NetworkCommissioningDriver.h", |
| "PlatformManagerImpl.h", |
| "PlatformManagerImpl.mm", |
| "PlatformMetricKeys.h", |
| "PosixConfig.cpp", |
| "PosixConfig.h", |
| "SystemPlatformConfig.h", |
| "SystemTimeSupport.cpp", |
| "UserDefaults.h", |
| "UserDefaults.mm", |
| "dnssd/DnssdContexts.cpp", |
| "dnssd/DnssdError.cpp", |
| "dnssd/DnssdError.h", |
| "dnssd/DnssdHostNameRegistrar.mm", |
| "dnssd/DnssdImpl.cpp", |
| "dnssd/DnssdImpl.h", |
| "dnssd/DnssdType.cpp", |
| "inet/NetworkMonitor.h", |
| "inet/NetworkMonitor.mm", |
| "system/SystemLayerImplDispatch.h", |
| "system/SystemLayerImplDispatch.mm", |
| ] |
| |
| if (chip_system_config_use_sockets) { |
| sources += [ "system/SystemLayerImplDispatchSockets.mm" ] |
| } |
| |
| if (chip_enable_wifi) { |
| sources += [ |
| "WiFi/ConfigurationManagerImplWiFi.cpp", |
| "WiFi/ConnectivityManagerImplWiFi.mm", |
| "WiFi/NetworkCommissioningWiFiDriver.h", |
| "WiFi/NetworkCommissioningWiFiDriver.mm", |
| ] |
| } |
| |
| if (!chip_disable_platform_kvs) { |
| sources += [ |
| "DeviceInstanceInfoProviderImpl.cpp", |
| "DeviceInstanceInfoProviderImpl.h", |
| "KeyValueStoreManagerImpl.h", |
| "KeyValueStoreManagerImpl.mm", |
| ] |
| } |
| |
| deps = [ |
| ":dnssd_buildconfig", |
| ":logging", |
| ":tracing", |
| "${chip_root}/src/app:app_config", |
| "${chip_root}/src/app/common:ids", |
| "${chip_root}/src/app/common:metadata", |
| "${chip_root}/src/lib/dnssd:platform_header", |
| "${chip_root}/src/platform/logging:headers", |
| "${chip_root}/src/setup_payload", |
| "${chip_root}/src/tracing", |
| ] |
| |
| public_deps = [ |
| "${chip_root}/src/app:app_config", |
| "${chip_root}/src/platform:platform_base", |
| ] |
| |
| public_configs = [ ":darwin_config" ] |
| |
| if (chip_enable_ota_requestor) { |
| sources += [ |
| # using the implements from Linux platform |
| "../Linux/OTAImageProcessorImpl.cpp", |
| "../Linux/OTAImageProcessorImpl.h", |
| ] |
| } |
| |
| if (chip_enable_ble) { |
| sources += [ |
| "BleApplicationDelegateImpl.h", |
| "BleApplicationDelegateImpl.mm", |
| "BleConnectionDelegateImpl.h", |
| "BleConnectionDelegateImpl.mm", |
| "BlePlatformDelegateImpl.h", |
| "BlePlatformDelegateImpl.mm", |
| "BleUtils.h", |
| "BleUtils.mm", |
| ] |
| } |
| |
| if (chip_enable_nfc_based_commissioning) { |
| sources += [ |
| "NFCCommissioningManagerImpl.cpp", |
| "NFCCommissioningManagerImpl.h", |
| ] |
| |
| deps += [ "${chip_root}/src/transport/raw:nfc-application-delegate" ] |
| } |
| } |
| |
| source_set("tracing") { |
| sources = [ |
| "Tracing.h", |
| "Tracing.mm", |
| ] |
| |
| deps = [ |
| ":logging", |
| "${chip_root}/src/tracing", |
| ] |
| } |
| |
| static_library("logging") { |
| sources = [ |
| "DispatchQueueNames.cpp", |
| "DispatchQueueNames.h", |
| "Logging.h", |
| "Logging.mm", |
| ] |
| |
| deps = [ |
| "${chip_root}/src/lib/support:attributes", |
| "${chip_root}/src/lib/support:logging_constants", |
| "${chip_root}/src/lib/support:span", |
| "${chip_root}/src/platform/logging:headers", |
| ] |
| |
| configs += [ "${chip_root}/src:includes" ] |
| cflags = [ "-Wconversion" ] |
| frameworks = [ "Foundation.framework" ] |
| } |