1# Copyright (c) 2024 Nordic Semiconductor ASA
2# SPDX-License-Identifier: Apache-2.0
3
4if(SB_CONFIG_VPR_LAUNCHER)
5  set(launcher_core "cpuapp")
6  string(REPLACE "/" ";" launcher_quals ${BOARD_QUALIFIERS})
7  list(LENGTH launcher_quals launcher_quals_len)
8  list(GET launcher_quals 1 launcher_soc)
9  list(GET launcher_quals 2 launcher_vpr)
10
11  string(REPLACE "cpu" "" launcher_vpr ${launcher_vpr})
12
13  if(launcher_quals_len EQUAL 4)
14    list(GET launcher_quals 3 launcher_variant)
15    set(launcher_vpr ${launcher_vpr}-${launcher_variant})
16  endif()
17
18  string(CONCAT launcher_board ${BOARD} "/" ${launcher_soc} "/" ${launcher_core})
19
20  set(image "vpr_launcher")
21
22  ExternalZephyrProject_Add(
23    APPLICATION ${image}
24    SOURCE_DIR ${ZEPHYR_BASE}/samples/basic/minimal
25    BOARD ${launcher_board}
26  )
27
28  string(CONCAT launcher_snippet "nordic-" ${launcher_vpr})
29
30  sysbuild_cache_set(VAR ${image}_SNIPPET APPEND REMOVE_DUPLICATES ${launcher_snippet})
31endif()
32