blob: 6af9db2bffd8b8f23da3cc5d956d8419be9da2f3 [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/p6.gni")
import("${build_root}/config/defaults.gni")
import("${p6_sdk_build_root}/p6_executable.gni")
import("${p6_sdk_build_root}/p6_sdk.gni")
assert(current_os == "freertos")
p6_project_dir = "${chip_root}/examples/lighting-app/p6"
examples_plat_dir = "${chip_root}/examples/platform/p6"
declare_args() {
# Dump memory usage at link time.
chip_print_memory_usage = false
# PIN code for PASE session establishment.
setup_pin_code = 20202021
# Monitor & log memory usage at runtime.
enable_heap_monitoring = false
}
p6_sdk_sources("lighting_app_sdk_sources") {
include_dirs = [
"${chip_root}/src/platform/P6",
"${p6_project_dir}/include",
"${examples_plat_dir}",
]
defines = [
"BOARD_ID=${p6_board}",
"P6_LOG_ENABLED=1",
"CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE=${setup_pin_code}",
]
sources = [ "${p6_project_dir}/include/CHIPProjectConfig.h" ]
public_configs = [ "${chip_root}/third_party/p6:p6_sdk_config" ]
}
p6_executable("lighting_app") {
include_dirs = []
defines = []
output_name = "chip-p6-lighting-example.out"
sources = [
"${examples_plat_dir}/LEDWidget.cpp",
"${examples_plat_dir}/init_p6Platform.cpp",
"src/AppTask.cpp",
"src/ButtonHandler.cpp",
"src/LightingManager.cpp",
"src/ZclCallbacks.cpp",
"src/main.cpp",
]
deps = [
":lighting_app_sdk_sources",
"${chip_root}/examples/common/QRCode",
"${chip_root}/examples/lighting-app/lighting-common",
"${chip_root}/src/lib",
"${chip_root}/src/setup_payload",
]
include_dirs += [
"include",
"${examples_plat_dir}",
"${p6_project_dir}/include",
]
defines = []
if (enable_heap_monitoring) {
sources += [ "${examples_plat_dir}/MemMonitoring.cpp" ]
defines += [ "HEAP_MONITORING" ]
}
if (chip_print_memory_usage) {
ldflags += [
"-Wl,--print-memory-usage",
"-fstack-usage",
]
}
output_dir = root_out_dir
}
group("p6") {
deps = [ ":lighting_app" ]
}
group("default") {
deps = [ ":p6" ]
}