1# Copyright 2024 NXP
2#
3# SPDX-License-Identifier: Apache-2.0
4
5if("${SB_CONFIG_REMOTE_BOARD}" STREQUAL "")
6    message(FATAL_ERROR
7    "Target ${BOARD} not supported for this sample. "
8    "There is no remote board selected in Kconfig.sysbuild")
9endif()
10
11set(REMOTE_APP remote)
12
13ExternalZephyrProject_Add(
14    APPLICATION ${REMOTE_APP}
15    SOURCE_DIR  ${APP_DIR}/${REMOTE_APP}
16    BOARD       ${SB_CONFIG_REMOTE_BOARD}
17)
18
19if(SB_CONFIG_BOARD_MIMXRT1160_EVK_MIMXRT1166_CM7 OR
20   SB_CONFIG_BOARD_MIMXRT1170_EVK_MIMXRT1176_CM7 OR
21   SB_CONFIG_BOARD_LPCXPRESSO55S69_LPC55S69_CPU0)
22  # For these NXP boards the main core application is dependent on
23  # 'zephyr_image_info.h' generated by remote application.
24
25  # Let's build the remote application first
26  add_dependencies(${DEFAULT_IMAGE} ${REMOTE_APP})
27endif()
28