| # 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/openthread.gni") |
| import("//build_overrides/qpg_sdk.gni") |
| |
| import("${build_root}/config/defaults.gni") |
| import("${qpg_sdk_build_root}/qpg_executable.gni") |
| import("${qpg_sdk_build_root}/qpg_sdk.gni") |
| assert(current_os == "freertos") |
| |
| qpg_project_dir = "${chip_root}/examples/lighting-app/qpg" |
| examples_plat_dir = "${chip_root}/examples/platform/qpg" |
| |
| qpg_sdk("sdk") { |
| sources = [ |
| "${examples_plat_dir}/app/include/Service.h", |
| "${examples_plat_dir}/project_include/CHIPProjectConfig.h", |
| ] |
| |
| include_dirs = [ |
| "${chip_root}/src/platform/qpg", |
| "${examples_plat_dir}/project_include", |
| ] |
| } |
| |
| qpg_executable("lighting_app") { |
| output_name = "chip-${qpg_target_ic}-lighting-example.out" |
| |
| sources = [ |
| "${chip_root}/examples/lighting-app/lighting-common/color_format/color_format.cpp", |
| "${examples_plat_dir}/app/main.cpp", |
| "src/AppTask.cpp", |
| "src/LightingManager.cpp", |
| "src/ZclCallbacks.cpp", |
| ] |
| |
| deps = [ |
| ":sdk", |
| "${chip_root}/examples/lighting-app/lighting-common/", |
| "${chip_root}/src/lib", |
| "${chip_root}/src/setup_payload", |
| "${chip_root}/third_party/openthread/platforms:libopenthread-platform", |
| "${chip_root}/third_party/openthread/platforms:libopenthread-platform-utils", |
| "${chip_root}/third_party/openthread/repo:libopenthread-cli-mtd", |
| "${chip_root}/third_party/openthread/repo:libopenthread-mtd", |
| ] |
| |
| cflags = [ "-Wconversion" ] |
| |
| include_dirs = [ |
| "${qpg_project_dir}/include/", |
| "${examples_plat_dir}", |
| "${examples_plat_dir}/app/include", |
| "${chip_root}/examples/lighting-app/lighting-common/color_format", |
| ] |
| |
| ldscript = "${qpg_sdk_root}/${qpg_target_ic}/ldscripts/chip-${qpg_target_ic}-example.ld" |
| |
| inputs = [ ldscript ] |
| |
| ldflags = [ "-T" + rebase_path(ldscript, root_build_dir) ] |
| |
| output_dir = root_out_dir |
| } |
| |
| group("qpg") { |
| deps = [ ":lighting_app" ] |
| } |
| |
| group("default") { |
| deps = [ ":qpg" ] |
| } |