blob: 768f6a25ba0e64df0a6c1171b0778b35930ae910 [file] [log] [blame]
# 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("${chip_root}/src/platform/device.gni")
assert(chip_device_platform == "esp32")
declare_args() {
# By default use default/example implementation of CommissionableDataProvider,
# DeviceAttestationCredentialsProvider and DeviceInstanceInforProvider
chip_use_factory_data_provider = false
chip_use_device_info_provider = false
chip_config_software_version_number = 0
chip_enable_chipoble = true
chip_bt_nimble_enabled = false
chip_bt_bluedroid_enabled = false
chip_enable_ble_controller = false
chip_use_secure_cert_dac_provider = false
chip_use_esp32_ecdsa_peripheral = false
chip_enable_ethernet = false
chip_enable_route_hook = false
}
defines = [
"CHIP_CONFIG_SOFTWARE_VERSION_NUMBER=${chip_config_software_version_number}",
]
static_library("ESP32") {
sources = [
"../SingletonConfigurationManager.cpp",
"CHIPDevicePlatformConfig.h",
"CHIPDevicePlatformEvent.h",
"ConfigurationManagerImpl.cpp",
"ConfigurationManagerImpl.h",
"ConnectivityManagerImpl.cpp",
"ConnectivityManagerImpl.h",
"DiagnosticDataProviderImpl.cpp",
"DiagnosticDataProviderImpl.h",
"ESP32Config.cpp",
"ESP32Config.h",
"ESP32Utils.cpp",
"ESP32Utils.h",
"KeyValueStoreManagerImpl.cpp",
"KeyValueStoreManagerImpl.h",
"Logging.cpp",
"LwIPCoreLock.cpp",
"PlatformManagerImpl.cpp",
"PlatformManagerImpl.h",
"SystemTimeSupport.cpp",
"SystemTimeSupport.h",
]
deps = [
"${chip_root}/src/lib/dnssd:platform_header",
"${chip_root}/src/platform/logging:headers",
"${chip_root}/src/setup_payload",
]
public = [
"${chip_root}/src/credentials/CHIPCert.h",
"${chip_root}/src/credentials/DeviceAttestationCredsProvider.h",
]
public_deps = [
"${chip_root}/src/crypto",
"${chip_root}/src/platform:platform_base",
]
if (chip_enable_ota_requestor) {
sources += [
"OTAImageProcessorImpl.cpp",
"OTAImageProcessorImpl.h",
]
}
if (chip_enable_chipoble) {
sources += [
"BLEManagerImpl.h",
"ChipDeviceScanner.h",
]
}
if (chip_enable_ble_controller) {
sources += [ "ChipDeviceScanner.h" ]
}
if (chip_bt_nimble_enabled) {
sources += [ "nimble/BLEManagerImpl.cpp" ]
if (chip_enable_ble_controller) {
sources += [
"nimble/ChipDeviceScanner.cpp",
"nimble/blecent.h",
"nimble/misc.c",
"nimble/peer.c",
]
}
}
if (chip_bt_bluedroid_enabled) {
sources += [ "bluedroid/BLEManagerImpl.cpp" ]
if (chip_enable_ble_controller) {
sources += [ "bluedroid/ChipDeviceScanner.cpp" ]
}
}
if (chip_enable_wifi) {
sources += [
"ConnectivityManagerImpl_WiFi.cpp",
"NetworkCommissioningDriver.cpp",
"NetworkCommissioningDriver.h",
]
if (chip_mdns == "platform") {
sources += [
"WiFiDnssdImpl.cpp",
"WiFiDnssdImpl.h",
]
}
if (chip_mdns == "minimal") {
sources += [ "ESP32EndpointQueueFilter.h" ]
}
if (chip_enable_route_hook) {
sources += [
"route_hook/ESP32RouteHook.c",
"route_hook/ESP32RouteHook.h",
"route_hook/ESP32RouteTable.c",
"route_hook/ESP32RouteTable.h",
]
}
}
if (chip_mdns == "platform") {
sources += [ "DnssdImpl.cpp" ]
}
if (chip_enable_ethernet) {
sources += [
"ConnectivityManagerImpl_Ethernet.cpp",
"NetworkCommissioningDriver_Ethernet.cpp",
]
}
if (chip_enable_openthread) {
sources += [
"../OpenThread/GenericNetworkCommissioningThreadDriver.cpp",
"../OpenThread/GenericNetworkCommissioningThreadDriver.h",
"../OpenThread/OpenThreadUtils.cpp",
"OpenthreadLauncher.cpp",
"OpenthreadLauncher.h",
"ThreadStackManagerImpl.cpp",
"ThreadStackManagerImpl.h",
]
if (chip_mdns == "platform") {
sources += [
"../OpenThread/OpenThreadDnssdImpl.cpp",
"../OpenThread/OpenThreadDnssdImpl.h",
]
}
configs -= [ "${chip_root}/build/config/compiler:warnings_default" ]
}
if (chip_use_factory_data_provider) {
sources += [
"ESP32FactoryDataProvider.cpp",
"ESP32FactoryDataProvider.h",
]
}
if (chip_use_device_info_provider) {
sources += [
"ESP32DeviceInfoProvider.cpp",
"ESP32DeviceInfoProvider.h",
]
}
if (chip_use_secure_cert_dac_provider) {
sources += [
"ESP32SecureCertDACProvider.cpp",
"ESP32SecureCertDACProvider.h",
]
}
if (chip_use_esp32_ecdsa_peripheral) {
sources += [
"ESP32CHIPCryptoPAL.cpp",
"ESP32CHIPCryptoPAL.h",
]
}
cflags = [ "-Wconversion" ]
}