blob: 4bc881f5f54a27beb4bc11d8c560c3308d2c1f4c [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}/build/chip/buildconfig_header.gni")
import("${chip_root}/src/crypto/crypto.gni")
import("${chip_root}/src/platform/device.gni")
import("${chip_root}/third_party/silabs/efr32_sdk.gni")
import("${chip_root}/third_party/silabs/silabs_board.gni")
silabs_platform_dir = "${chip_root}/src/platform/silabs"
assert(chip_device_platform == "efr32")
if (chip_enable_openthread) {
import("//build_overrides/openthread.gni")
}
if (chip_crypto == "platform") {
import("//build_overrides/mbedtls.gni")
}
config("efr32-platform-wifi-config") {
include_dirs = [ "wifi" ]
defines = []
}
static_library("efr32") {
sources = [
"${silabs_platform_dir}/BLEManagerImpl.h",
"${silabs_platform_dir}/BlePlatformConfig.h",
"${silabs_platform_dir}/CHIPDevicePlatformConfig.h",
"${silabs_platform_dir}/CHIPDevicePlatformEvent.h",
"${silabs_platform_dir}/CHIPMem-Platform.cpp",
"${silabs_platform_dir}/CHIPPlatformConfig.h",
"${silabs_platform_dir}/ConfigurationManagerImpl.cpp",
"${silabs_platform_dir}/ConfigurationManagerImpl.h",
"${silabs_platform_dir}/ConnectivityManagerImpl.h",
"${silabs_platform_dir}/DiagnosticDataProviderImpl.cpp",
"${silabs_platform_dir}/DiagnosticDataProviderImpl.h",
"${silabs_platform_dir}/InetPlatformConfig.h",
"${silabs_platform_dir}/KeyValueStoreManagerImpl.cpp",
"${silabs_platform_dir}/KeyValueStoreManagerImpl.h",
"${silabs_platform_dir}/MigrationManager.cpp",
"${silabs_platform_dir}/PlatformManagerImpl.cpp",
"${silabs_platform_dir}/PlatformManagerImpl.h",
"${silabs_platform_dir}/SilabsConfig.cpp",
"${silabs_platform_dir}/SilabsConfig.h",
"${silabs_platform_dir}/SystemPlatformConfig.h",
"${silabs_platform_dir}/platformAbstraction/GsdkSpam.cpp",
"${silabs_platform_dir}/platformAbstraction/SilabsPlatform.h",
"${silabs_platform_dir}/platformAbstraction/SilabsPlatformBase.h",
"../../FreeRTOS/SystemTimeSupport.cpp",
"../../SingletonConfigurationManager.cpp",
]
if (chip_enable_ble_rs911x) {
sources += [
"../rs911x/BLEManagerImpl.cpp",
"../rs911x/rsi_ble_config.h",
"../rs911x/wfx_sl_ble_init.cpp",
"../rs911x/wfx_sl_ble_init.h",
]
} else {
sources += [ "BLEManagerImpl.cpp" ]
}
if (chip_enable_multi_ota_requestor) {
if (chip_enable_multi_ota_encryption) {
sources += [
"${silabs_platform_dir}/multi-ota/OtaTlvEncryptionKey.cpp",
"${silabs_platform_dir}/multi-ota/OtaTlvEncryptionKey.h",
]
}
if (chip_enable_ota_custom_tlv_testing) {
sources += [
"${silabs_platform_dir}/multi-ota/OTACustomProcessor.cpp",
"${silabs_platform_dir}/multi-ota/OTACustomProcessor.h",
]
}
sources += [
"${silabs_platform_dir}/multi-ota/OTAFactoryDataProcessor.cpp",
"${silabs_platform_dir}/multi-ota/OTAFactoryDataProcessor.h",
"${silabs_platform_dir}/multi-ota/OTAFirmwareProcessor.cpp",
"${silabs_platform_dir}/multi-ota/OTAFirmwareProcessor.h",
"${silabs_platform_dir}/multi-ota/OTAHooks.cpp",
"${silabs_platform_dir}/multi-ota/OTAMultiImageProcessorImpl.cpp",
"${silabs_platform_dir}/multi-ota/OTAMultiImageProcessorImpl.h",
"${silabs_platform_dir}/multi-ota/OTATlvProcessor.cpp",
"${silabs_platform_dir}/multi-ota/OTATlvProcessor.h",
]
} else if (chip_enable_ota_requestor) {
sources += [
"${silabs_platform_dir}/OTAImageProcessorImpl.h",
"OTAImageProcessorImpl.cpp",
]
}
public_deps = [
"${chip_root}/src/platform:platform_base",
"${chip_root}/src/platform/logging:headers",
]
deps = [ "${silabs_platform_dir}/provision:provision-headers" ]
public_configs = []
# Add platform crypto implementation
if (chip_crypto == "platform") {
sources += [
"CHIPCryptoPALPsaEfr32.cpp",
"Efr32OpaqueKeypair.h",
"Efr32PsaOpaqueKeypair.cpp",
"Efr32PsaOperationalKeystore.cpp",
"Efr32PsaOperationalKeystore.h",
]
public_deps += [
"${chip_root}/src/crypto",
"${mbedtls_root}:mbedtls",
]
}
if (chip_enable_openthread) {
public_deps += [ "${chip_root}/third_party/openthread:openthread" ]
deps += [ "${chip_root}/third_party/openthread:openthread_cli" ]
sources += [
"${silabs_platform_dir}/ThreadStackManagerImpl.h",
"../../OpenThread/OpenThreadUtils.cpp",
"ConnectivityManagerImpl.cpp",
"ThreadStackManagerImpl.cpp",
]
if (chip_mdns == "platform") {
sources += [
"../../OpenThread/DnssdImpl.cpp",
"../../OpenThread/OpenThreadDnssdImpl.cpp",
"../../OpenThread/OpenThreadDnssdImpl.h",
]
deps += [ "${chip_root}/src/lib/dnssd:platform_header" ]
}
}
if (chip_enable_wifi) {
sources += [
"${silabs_platform_dir}/ConnectivityManagerImpl_WIFI.cpp",
"${silabs_platform_dir}/NetworkCommissioningWiFiDriver.cpp",
"${silabs_platform_dir}/NetworkCommissioningWiFiDriver.h",
"${silabs_platform_dir}/wifi/wfx_host_events.h",
"wifi/wfx_msgs.h",
"wifi/wifi_config.h",
]
if (use_wf200 || use_rs9116 || use_SiWx917) {
sources += [
"${silabs_platform_dir}/wifi/dhcp_client.cpp",
"wifi/ethernetif.cpp",
"wifi/ethernetif.h",
"wifi/lwip_netif.cpp",
]
}
public_configs += [ ":efr32-platform-wifi-config" ]
}
}
source_set("logging") {
sources = [ "${chip_root}/src/platform/silabs/Logging.cpp" ]
deps = [
"${chip_root}/src/platform:platform_base",
"${chip_root}/src/platform/logging:headers",
]
}