blob: 077e85214754cad572ed044ef282071d485e74cc [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("${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/persistent-storage/efr32"
examples_plat_dir = "${chip_root}/examples/platform/efr32"
efr32_sdk("sdk") {
sources = [
"${efr32_project_dir}/include/CHIPProjectConfig.h",
"${efr32_project_dir}/include/FreeRTOSConfig.h",
]
include_dirs = [
"${chip_root}/src/platform/EFR32",
"${efr32_project_dir}/include",
"${efr32_project_dir}/src",
"${examples_plat_dir}",
"${examples_plat_dir}/${efr32_family}/${efr32_board}",
]
defines = [
"BOARD_ID=${efr32_board}",
"SL_HEAP_SIZE=(10 * 1024)",
]
}
efr32_executable("persistent_storage") {
output_name = "chip-efr32-persistent_storage-example.out"
sources = [
"${efr32_project_dir}/../KeyValueStorageTest.cpp",
"${examples_plat_dir}/init_efrPlatform.cpp",
"${examples_plat_dir}/uart.c",
"main.cpp",
]
deps = [
":sdk",
"$dir_pw_assert",
"$dir_pw_kvs:crc16",
"${chip_root}/src/lib",
]
include_dirs = [
"${efr32_project_dir}/..",
"${efr32_project_dir}/include",
]
if (efr32_family == "efr32mg12") {
ldscript = "${examples_plat_dir}/ldscripts/efr32-MG12P.ld"
} else if (efr32_family == "efr32mg21") {
ldscript = "${examples_plat_dir}/ldscripts/efr32-MG21.ld"
}
inputs = [ ldscript ]
ldflags = [ "-T" + rebase_path(ldscript, root_build_dir) ]
output_dir = root_out_dir
}
group("efr32") {
deps = [ ":persistent_storage" ]
}
group("default") {
deps = [ ":efr32" ]
}