| # 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/efr32_sdk.gni") |
| |
| import("${chip_root}/src/platform/silabs/multi-ota/args.gni") |
| import("${chip_root}/third_party/silabs/efr32_sdk.gni") |
| import("${chip_root}/third_party/silabs/silabs_board.gni") |
| import("${matter_support_root}/provision/args.gni") |
| |
| config("multi-ota-common-config") { |
| defines = [] |
| include_dirs = [ "${silabs_platform_dir}/multi-ota" ] |
| |
| if (chip_enable_multi_ota_requestor) { |
| defines += [ "SL_MATTER_ENABLE_MULTI_OTA_REQUESTOR=1" ] |
| |
| if (chip_enable_multi_ota_encryption) { |
| defines += [ "SL_MATTER_ENABLE_OTA_ENCRYPTION=1" ] |
| } |
| |
| if (chip_enable_ota_custom_tlv_testing) { |
| defines += [ "OTA_TEST_CUSTOM_TLVS=1" ] |
| } |
| } |
| } |
| |
| config("multi-ota-siwx-config") { |
| include_dirs = [ "${silabs_platform_dir}/multi-ota/SiWx917" ] |
| } |
| |
| source_set("multi-ota-common") { |
| sources = [ |
| "OTAFactoryDataProcessor.cpp", |
| "OTAHooks.cpp", |
| "OTAMultiImageProcessorImpl.cpp", |
| "OTATlvProcessor.cpp", |
| ] |
| public_deps = [ |
| "${chip_root}/src/lib/core", |
| "${chip_root}/src/lib/support", |
| "${silabs_platform_dir}/platformAbstraction:common", |
| "${sl_provision_root}:headers", |
| ] |
| |
| if (chip_enable_ota_custom_tlv_testing) { |
| sources += [ "${silabs_platform_dir}/multi-ota/OTACustomProcessor.cpp" ] |
| } |
| public_configs = [ ":multi-ota-common-config" ] |
| } |
| |
| source_set("multi-ota-efr32") { |
| sources = [ "OTAFirmwareProcessor.cpp" ] |
| public_deps = [ |
| ":multi-ota-common", |
| "${silabs_platform_dir}/platformAbstraction:gsdk", |
| ] |
| |
| # WiFi-specific sources and dependencies for NCP builds |
| if (use_SiWx917) { |
| sources += [ "SiWx917/OTAWiFiFirmwareProcessor.cpp" ] |
| public_deps += [ "${silabs_platform_dir}/wifi:wifi-platform" ] |
| public_configs = [ ":multi-ota-siwx-config" ] |
| } |
| |
| if (chip_enable_multi_ota_encryption) { |
| sources += [ "${silabs_platform_dir}/multi-ota/OtaTlvEncryptionKey.cpp" ] |
| } |
| } |
| |
| source_set("multi-ota-siwx") { |
| sources = [ "SiWx917/OTAWiFiFirmwareProcessor.cpp" ] |
| public_deps = [ |
| ":multi-ota-common", |
| "${silabs_platform_dir}/platformAbstraction:wisemcu", |
| "${silabs_platform_dir}/wifi:wifi-platform", |
| ] |
| if (chip_enable_multi_ota_encryption) { |
| sources += [ "${silabs_platform_dir}/multi-ota/OtaTlvEncryptionKey.cpp" ] |
| } |
| public_configs = [ ":multi-ota-siwx-config" ] |
| } |