cmake: support multiple entries in board.cmake

Currently there is no way to support running a board on multiple
emulation platforms nor to choose a desired emulation platform for the
simulation to be run on. This commit introduces a new
SUPPORTED_EMU_PLATFORMS list, which defines available emulation
platforms for a given board.

Fixes #12375.

Signed-off-by: Filip Kokosinski <fkokosinski@antmicro.com>
This commit is contained in:
Filip Kokosinski 2021-08-30 13:09:48 +02:00 committed by Anas Nashif
commit 94428044e2
32 changed files with 71 additions and 66 deletions

View file

@ -1603,8 +1603,17 @@ if(HEX_FILES_TO_MERGE)
message(VERBOSE "Merging hex files: ${HEX_FILES_TO_MERGE}")
endif()
if(EMU_PLATFORM)
include(${ZEPHYR_BASE}/cmake/emu/${EMU_PLATFORM}.cmake)
if(SUPPORTED_EMU_PLATFORMS)
list(GET SUPPORTED_EMU_PLATFORMS 0 default_emu)
add_custom_target(run DEPENDS run_${default_emu})
foreach(EMU_PLATFORM ${SUPPORTED_EMU_PLATFORMS})
include(${ZEPHYR_BASE}/cmake/emu/${EMU_PLATFORM}.cmake)
endforeach()
if(TARGET debugserver_${default_emu})
add_custom_target(debugserver DEPENDS debugserver_${default_emu})
endif()
else()
add_custom_target(run
COMMAND