1# Copyright 2024-2025 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_MIMXRT1180_EVK_MIMXRT1189_CM33 OR
22   SB_CONFIG_BOARD_LPCXPRESSO55S69_LPC55S69_CPU0)
23  # For these NXP boards the main core application is dependent on
24  # 'zephyr_image_info.h' generated by remote application.
25
26  # Let's build the remote application first
27  add_dependencies(${DEFAULT_IMAGE} ${REMOTE_APP})
28endif()
29