| # Copyright (c) 2020 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/nrf5_sdk.gni") |
| |
| import("${nrf5_sdk_build_root}/nrf5_sdk.gni") |
| |
| assert(current_os == "freertos") |
| |
| nrf5_platform_dir = "${chip_root}/examples/platform/nrf528xx" |
| |
| nrf5_sdk("sdk") { |
| include_dirs = [ |
| "main/include", |
| "main", |
| "${nrf5_platform_dir}/app/project_include", |
| "${nrf5_platform_dir}/util/include", |
| "${nrf5_platform_dir}/app/include", |
| "${chip_root}/src/app/util", |
| ] |
| |
| sources = [ |
| "${nrf5_platform_dir}/app/project_include/CHIPProjectConfig.h", |
| "${nrf5_platform_dir}/app/project_include/FreeRTOSConfig.h", |
| "${nrf5_platform_dir}/app/project_include/OpenThreadConfig.h", |
| "${nrf5_platform_dir}/app/project_include/freertos_tasks_c_additions.h", |
| "${nrf5_platform_dir}/app/project_include/nrf_log_ctrl_internal.h", |
| "main/include/app_config.h", |
| ] |
| |
| defines = [] |
| if (is_debug) { |
| defines += [ "BUILD_RELEASE=0" ] |
| } else { |
| defines += [ "BUILD_RELEASE=1" ] |
| } |
| |
| defines += [ "USE_APP_CONFIG" ] |
| } |
| |
| executable("lighting_app") { |
| output_name = "chip-nrf52840-lighting-example" |
| |
| sources = [ |
| "${chip_root}/src/app/clusters/on-off-server/on-off.c", |
| "${chip_root}/src/app/util/attribute-size.c", |
| "${chip_root}/src/app/util/attribute-storage.c", |
| "${chip_root}/src/app/util/attribute-table.c", |
| "${chip_root}/src/app/util/chip-response.cpp", |
| "${chip_root}/src/app/util/client-api.c", |
| "${chip_root}/src/app/util/ember-print.cpp", |
| "${chip_root}/src/app/util/message.c", |
| "${chip_root}/src/app/util/process-cluster-message.c", |
| "${chip_root}/src/app/util/process-global-message.c", |
| "${chip_root}/src/app/util/util.c", |
| "${nrf5_platform_dir}/app/Server.cpp", |
| "${nrf5_platform_dir}/app/chipinit.cpp", |
| "${nrf5_platform_dir}/app/include/Server.h", |
| "${nrf5_platform_dir}/app/include/chipinit.h", |
| "${nrf5_platform_dir}/app/support/CXXExceptionStubs.cpp", |
| "${nrf5_platform_dir}/app/support/nRF5Sbrk.c", |
| "${nrf5_platform_dir}/util/LEDWidget.cpp", |
| "${nrf5_platform_dir}/util/include/LEDWidget.h", |
| "main/AppTask.cpp", |
| "main/DataModelHandler.cpp", |
| "main/LightingManager.cpp", |
| "main/gen/call-command-handler.c", |
| "main/gen/callback-stub.c", |
| "main/gen/znet-bookkeeping.c", |
| "main/include/AppEvent.h", |
| "main/include/AppTask.h", |
| "main/include/DataModelHandler.h", |
| "main/include/LightingManager.h", |
| "main/main.cpp", |
| ] |
| |
| deps = [ |
| ":sdk", |
| "${chip_root}/src/lib", |
| "${chip_root}/src/setup_payload", |
| "${chip_root}/third_party/openthread/platforms/nrf528xx:libnordicsemi_nrf52840_radio_driver_softdevice", |
| "${chip_root}/third_party/openthread/platforms/nrf528xx:libopenthread-nrf52840-softdevice-sdk", |
| "${nrf5_platform_dir}/app/support:freertos_debugging_hooks", |
| "${nrf5_platform_dir}/app/support:freertos_newlib_lock_support", |
| "${nrf5_platform_dir}/app/support:freertos_newlib_lock_support_test", |
| "${openthread_root}:libopenthread-cli-ftd", |
| "${openthread_root}:libopenthread-ftd", |
| ] |
| |
| output_dir = root_out_dir |
| |
| ldscript = "${nrf5_platform_dir}/app/ldscripts/chip-nrf52840-example.ld" |
| |
| ldflags = [ "-T" + rebase_path(ldscript, root_build_dir) ] |
| } |
| |
| group("nrf5") { |
| deps = [ ":lighting_app" ] |
| } |