native_sim: Add new native_sim board

Add the new native_sim board, based on the native simulator.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
This commit is contained in:
Alberto Escolar Piedras 2023-06-07 10:39:48 +02:00 committed by Chris Friedt
commit ece74b7b7f
32 changed files with 1208 additions and 16 deletions

View file

@ -1764,15 +1764,32 @@ if(CONFIG_BUILD_OUTPUT_STRIPPED)
endif()
if(CONFIG_BUILD_OUTPUT_EXE)
list(APPEND
post_build_commands
COMMAND
${CMAKE_COMMAND} -E copy ${KERNEL_ELF_NAME} ${KERNEL_EXE_NAME}
)
list(APPEND
post_build_byproducts
${KERNEL_EXE_NAME}
if (NOT CONFIG_NATIVE_LIBRARY)
list(APPEND
post_build_commands
COMMAND
${CMAKE_COMMAND} -E copy ${KERNEL_ELF_NAME} ${KERNEL_EXE_NAME}
)
list(APPEND
post_build_byproducts
${KERNEL_EXE_NAME}
)
else()
if(CMAKE_GENERATOR STREQUAL "Unix Makefiles")
set(MAKE "${CMAKE_MAKE_PROGRAM}" CACHE FILEPATH "cmake defined make")
endif()
find_program(MAKE make REQUIRED)
add_custom_target(native_runner_executable
ALL
COMMENT "Building native simulator runner, and linking final executable"
COMMAND
${MAKE} -f ${ZEPHYR_BASE}/scripts/native_simulator/Makefile all --warn-undefined-variables
-r NSI_CONFIG_FILE=${CMAKE_BINARY_DIR}/zephyr/NSI/nsi_config
# nsi_config is created by the board cmake file
DEPENDS ${logical_target_for_zephyr_elf}
BYPRODUCTS ${KERNEL_EXE_NAME}
)
endif()
endif()
if(CONFIG_BUILD_OUTPUT_INFO_HEADER)