| # Copyright (c) 2022 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/mbedtls.gni") |
| import("//build_overrides/mt793x_sdk.gni") |
| import("${chip_root}/src/crypto/crypto.gni") |
| import("${chip_root}/src/platform/mt793x/args.gni") |
| import("${chip_root}/src/platform/mt793x/lwip/lwip.gni") |
| |
| # |
| # Defines an mt793x SDK build target. |
| # |
| # Parameters: |
| # sources - Extra source files to build. |
| # |
| |
| declare_args() { |
| mt793x_sdk_developer = getenv("MTK_DEV") |
| } |
| |
| if (mt793x_sdk_developer == "") { |
| import( |
| "${mt793x_sdk_build_root}/filogic/project/mt7933_hdk/apps/matter_sdk/matter_sdk.gni") |
| } else { |
| import( |
| "${mt793x_sdk_build_root}/filogic/project/mt7933_hdk/apps/matter_sdk/matter_sdk_internal.gni") |
| } |
| |
| template("mt793x_sdk") { |
| sdk_target_name = target_name |
| |
| matter_sdk("matter_sdk") { |
| include_dirs = [] |
| |
| if (defined(invoker.include_dirs)) { |
| include_dirs += invoker.include_dirs |
| } |
| |
| include_dirs += [ |
| "${lwip_root}/repo/lwip/ports/include", |
| "${lwip_root}/repo/lwip/src/include", |
| ] |
| |
| defines = [] |
| |
| if (chip_mdns == "platform") { |
| defines += [ |
| "OPENTHREAD_CONFIG_SRP_CLIENT_ENABLE=1", |
| "OPENTHREAD_CONFIG_ECDSA_ENABLE=1", |
| "OPENTHREAD_CONFIG_DNS_CLIENT_SERVICE_DISCOVERY_ENABLE=1", |
| "OPENTHREAD_CONFIG_DNS_CLIENT_ENABLE=1", |
| ] |
| } |
| } |
| |
| config("${sdk_target_name}_config") { |
| if (!defined(include_dirs)) { |
| include_dirs = [] |
| } |
| |
| if (defined(invoker.include_dirs)) { |
| include_dirs += invoker.include_dirs |
| } |
| |
| libs = [] |
| |
| defines = [] |
| |
| if (defined(invoker.defines)) { |
| defines += invoker.defines |
| } |
| } |
| |
| # TODO - Break up this monolith and make it configurable. |
| source_set(sdk_target_name) { |
| forward_variables_from(invoker, "*") |
| |
| if (!defined(sources)) { |
| sources = [] |
| } |
| |
| if (!defined(public_configs)) { |
| public_configs = [] |
| } |
| |
| public_deps = [ ":matter_sdk" ] |
| |
| public_configs += [ ":${sdk_target_name}_config" ] |
| } |
| } |