samples/bluetooth: Reduce sysbuild boilerplate

Reduce the sysbuild boilerplate required for
the nrf5340bsim targets.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
This commit is contained in:
Alberto Escolar Piedras 2023-11-29 18:44:30 +01:00 committed by Anas Nashif
parent 94cdfa60dc
commit 8b70d98dcb
4 changed files with 8 additions and 88 deletions

View file

@ -18,27 +18,7 @@ if(SB_CONFIG_NET_CORE_IMAGE_HCI_IPC)
CACHE INTERNAL ""
)
# Let's build the net core library first
add_dependencies(${DEFAULT_IMAGE} ${NET_APP})
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}/${NET_APP}/zephyr/zephyr.elf)
set_property(TARGET ${DEFAULT_IMAGE} APPEND_STRING PROPERTY CONFIG
"CONFIG_NATIVE_SIMULATOR_EXTRA_IMAGE_PATHS=\"${NET_LIBRARY_PATH}\"\n"
)
endif()
native_simulator_set_child_images(${DEFAULT_IMAGE} ${NET_APP})
endif()
if(("${BOARD}" MATCHES "native") OR ("${BOARD}" MATCHES "bsim"))
# Let's meet the expectation 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})

View file

@ -18,27 +18,7 @@ if(SB_CONFIG_NET_CORE_IMAGE_HCI_IPC)
CACHE INTERNAL ""
)
# Let's build the net core library first
add_dependencies(${DEFAULT_IMAGE} ${NET_APP})
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}/${NET_APP}/zephyr/zephyr.elf)
set_property(TARGET ${DEFAULT_IMAGE} APPEND_STRING PROPERTY CONFIG
"CONFIG_NATIVE_SIMULATOR_EXTRA_IMAGE_PATHS=\"${NET_LIBRARY_PATH}\"\n"
)
endif()
native_simulator_set_child_images(${DEFAULT_IMAGE} ${NET_APP})
endif()
if(("${BOARD}" MATCHES "native") OR ("${BOARD}" MATCHES "bsim"))
# Let's meet the expectation 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})

View file

@ -18,27 +18,7 @@ if(SB_CONFIG_NET_CORE_IMAGE_HCI_IPC)
CACHE INTERNAL ""
)
# Let's build the net core library first
add_dependencies(${DEFAULT_IMAGE} ${NET_APP})
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}/${NET_APP}/zephyr/zephyr.elf)
set_property(TARGET ${DEFAULT_IMAGE} APPEND_STRING PROPERTY CONFIG
"CONFIG_NATIVE_SIMULATOR_EXTRA_IMAGE_PATHS=\"${NET_LIBRARY_PATH}\"\n"
)
endif()
native_simulator_set_child_images(${DEFAULT_IMAGE} ${NET_APP})
endif()
if(("${BOARD}" MATCHES "native") OR ("${BOARD}" MATCHES "bsim"))
# Let's meet the expectation 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})

View file

@ -18,27 +18,7 @@ if(SB_CONFIG_NET_CORE_IMAGE_HCI_IPC)
CACHE INTERNAL ""
)
# Let's build the net core library first
add_dependencies(${DEFAULT_IMAGE} ${NET_APP})
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}/${NET_APP}/zephyr/zephyr.elf)
set_property(TARGET ${DEFAULT_IMAGE} APPEND_STRING PROPERTY CONFIG
"CONFIG_NATIVE_SIMULATOR_EXTRA_IMAGE_PATHS=\"${NET_LIBRARY_PATH}\"\n"
)
endif()
native_simulator_set_child_images(${DEFAULT_IMAGE} ${NET_APP})
endif()
if(("${BOARD}" MATCHES "native") OR ("${BOARD}" MATCHES "bsim"))
# Let's meet the expectation 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})