Skip to content

Commit

Permalink
samples/drivers/mbox: Reduce sysbuild boilerplate
Browse files Browse the repository at this point in the history
Reduce the sysbuild boilerplate required for
the nrf5340bsim targets

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
  • Loading branch information
aescolar authored and nashif committed Dec 2, 2023
1 parent cbce338 commit d2151aa
Showing 1 changed file with 2 additions and 20 deletions.
22 changes: 2 additions & 20 deletions samples/drivers/mbox/sysbuild.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,6 @@ ExternalZephyrProject_Add(
BOARD ${SB_CONFIG_REMOTE_BOARD}
)

if("${BOARD}" STREQUAL "nrf5340bsim_nrf5340_cpuapp")
# For the simulated board, the application core build will produce the final executable
# for that, we give it the path to the netcore image
set(NET_LIBRARY_PATH ${CMAKE_BINARY_DIR}/${REMOTE_APP}/zephyr/zephyr.elf)
set_property(TARGET ${DEFAULT_IMAGE} APPEND_STRING PROPERTY CONFIG
"CONFIG_NATIVE_SIMULATOR_EXTRA_IMAGE_PATHS=\"${NET_LIBRARY_PATH}\"\n"
)
native_simulator_set_child_images(${DEFAULT_IMAGE} ${REMOTE_APP})

# Let's build the net core library first
add_dependencies(${DEFAULT_IMAGE} ${REMOTE_APP})

# Let's meet users expectations of finding the final executable in zephyr/zephyr.exe
add_custom_target(final_executable
ALL
COMMAND
${CMAKE_COMMAND} -E copy
${CMAKE_BINARY_DIR}/${DEFAULT_IMAGE}/zephyr/zephyr.exe
${CMAKE_BINARY_DIR}/zephyr/zephyr.exe
DEPENDS ${DEFAULT_IMAGE}
)
endif()
native_simulator_set_final_executable(${DEFAULT_IMAGE})

0 comments on commit d2151aa

Please sign in to comment.