|
| 1 | +# |
| 2 | +# Copyright (c) 2024 Project CHIP Authors |
| 3 | +# |
| 4 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | +# you may not use this file except in compliance with the License. |
| 6 | +# You may obtain a copy of the License at |
| 7 | +# |
| 8 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | +# |
| 10 | +# Unless required by applicable law or agreed to in writing, software |
| 11 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | +# See the License for the specific language governing permissions and |
| 14 | +# limitations under the License. |
| 15 | +# |
| 16 | +cmake_minimum_required(VERSION 3.13.1) |
| 17 | + |
| 18 | +get_filename_component(CHIP_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/third_party/connectedhomeip REALPATH) |
| 19 | +get_filename_component(NRFCONNECT_COMMON ${CHIP_ROOT}/examples/platform/nrfconnect REALPATH) |
| 20 | +get_filename_component(GEN_DIR ${CHIP_ROOT}/zzz_generated/ REALPATH) |
| 21 | + |
| 22 | +include(${CHIP_ROOT}/config/nrfconnect/app/check-nrfconnect-version.cmake) |
| 23 | + |
| 24 | +# Set Kconfig root files that will be processed as a first Kconfig for used child images. |
| 25 | +set(mcuboot_KCONFIG_ROOT ${CHIP_ROOT}/config/nrfconnect/chip-module/Kconfig.mcuboot.root) |
| 26 | +set(multiprotocol_rpmsg_KCONFIG_ROOT ${CHIP_ROOT}/config/nrfconnect/chip-module/Kconfig.multiprotocol_rpmsg.root) |
| 27 | + |
| 28 | +if(NOT CONF_FILE STREQUAL "prj_no_dfu.conf") |
| 29 | + set(PM_STATIC_YML_FILE ${CMAKE_CURRENT_SOURCE_DIR}/configuration/${BOARD}/pm_static_dfu.yml) |
| 30 | +endif() |
| 31 | + |
| 32 | +list(APPEND ZEPHYR_EXTRA_MODULES ${CHIP_ROOT}/config/nrfconnect/chip-module) |
| 33 | +find_package(Zephyr HINTS $ENV{ZEPHYR_BASE}) |
| 34 | + |
| 35 | +# -Wmaybe-uninitialized has too many false positives, including on std::optional |
| 36 | +# and chip::Optional. Make it nonfatal. |
| 37 | +# |
| 38 | +# See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80635 |
| 39 | +target_compile_options(app PRIVATE -Werror -Wno-error=maybe-uninitialized) |
| 40 | + |
| 41 | +project(chip-nrfconnect-lit-icd-app-example) |
| 42 | + |
| 43 | +include(${CHIP_ROOT}/config/nrfconnect/app/enable-gnu-std.cmake) |
| 44 | +include(${CHIP_ROOT}/config/nrfconnect/app/flashing.cmake) |
| 45 | +include(${CHIP_ROOT}/src/app/chip_data_model.cmake) |
| 46 | + |
| 47 | +target_include_directories(app PRIVATE |
| 48 | + main/include |
| 49 | + ${GEN_DIR}/app-common |
| 50 | + ${GEN_DIR}/lit-icd-app |
| 51 | + ${NRFCONNECT_COMMON}/util/include |
| 52 | + ${NRFCONNECT_COMMON}/app/include) |
| 53 | + |
| 54 | +target_sources(app PRIVATE |
| 55 | + main/AppTask.cpp |
| 56 | + main/main.cpp |
| 57 | + ${NRFCONNECT_COMMON}/util/LEDWidget.cpp) |
| 58 | + |
| 59 | +chip_configure_data_model(app |
| 60 | + INCLUDE_SERVER |
| 61 | + ZAP_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../lit-icd-common/lit-icd-server-app.zap |
| 62 | +) |
| 63 | + |
| 64 | +if(CONFIG_CHIP_OTA_REQUESTOR) |
| 65 | + target_sources(app PRIVATE ${NRFCONNECT_COMMON}/util/OTAUtil.cpp) |
| 66 | +endif() |
0 commit comments