blob: cdc2bcacbc8fa8cf7284df7b36b0529341b1f09f [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/build.gni")
import("//build_overrides/chip.gni")
import("//build_overrides/efr32_sdk.gni")
import("//build_overrides/pigweed.gni")
import("${build_root}/config/defaults.gni")
import("${chip_root}/config/efr32/lib/pw_rpc/pw_rpc.gni")
import("${efr32_sdk_build_root}/efr32_executable.gni")
import("${efr32_sdk_build_root}/efr32_sdk.gni")
assert(current_os == "freertos")
efr32_project_dir = "${chip_root}/examples/pigweed-app/efr32"
examples_plat_dir = "${chip_root}/examples/platform/efr32"
efr32_sdk("sdk") {
sources = [
"${efr32_project_dir}/include/CHIPProjectConfig.h",
"${examples_plat_dir}/FreeRTOSConfig.h",
]
include_dirs = [
"${chip_root}/src/platform/EFR32",
"${efr32_project_dir}/include",
"${examples_plat_dir}",
]
defines = [
"BOARD_ID=${silabs_board}",
"HAL_VCOM_ENABLE=1",
"EFR32_LOG_ENABLED=1",
"PW_RPC_ENABLED",
]
}
efr32_executable("pigweed_app") {
output_name = "chip-efr32-pigweed-example.out"
sources = [
"${chip_root}/examples/common/pigweed/RpcService.cpp",
"${chip_root}/examples/common/pigweed/efr32/PigweedLoggerMutex.cpp",
"${examples_plat_dir}/PigweedLogger.cpp",
"${examples_plat_dir}/heap_4_silabs.c",
"${examples_plat_dir}/init_efrPlatform.cpp",
"${examples_plat_dir}/uart.cpp",
"src/main.cpp",
]
if (use_wstk_leds) {
sources += [ "${examples_plat_dir}/LEDWidget.cpp" ]
}
deps = [
":sdk",
"$dir_pw_assert",
"$dir_pw_checksum",
"${chip_root}/config/efr32/lib/pw_rpc:pw_rpc",
"${chip_root}/examples/common/pigweed:system_rpc_server",
"${chip_root}/src/lib",
"${examples_plat_dir}/pw_sys_io:pw_sys_io_efr32",
]
include_dirs = [ "${chip_root}/examples/common/pigweed/efr32" ]
ldscript = "${examples_plat_dir}/ldscripts/${silabs_family}.ld"
inputs = [ ldscript ]
ldflags = [ "-T" + rebase_path(ldscript, root_build_dir) ]
output_dir = root_out_dir
}
group("efr32") {
deps = [ ":pigweed_app" ]
}
group("default") {
deps = [ ":efr32" ]
}