native_sim: Define path to native_simulator on arch cmake files

To allow reusing the path between boards,
instead of defining it in the board, let's define it in
the arch cmake file.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
This commit is contained in:
Alberto Escolar Piedras 2023-08-02 14:46:27 +02:00 committed by Carles Cufí
commit 232b4b0a7a
2 changed files with 2 additions and 2 deletions

View file

@ -27,6 +27,8 @@ endif()
# We use target_link_options() instead # We use target_link_options() instead
add_library(native_simulator INTERFACE) add_library(native_simulator INTERFACE)
set(NSI_DIR ${ZEPHYR_BASE}/scripts/native_simulator CACHE PATH "Path to the native simulator")
if(EXISTS ${CMAKE_CURRENT_LIST_DIR}/${CMAKE_HOST_SYSTEM_NAME}.${CMAKE_HOST_SYSTEM_PROCESSOR}.cmake) if(EXISTS ${CMAKE_CURRENT_LIST_DIR}/${CMAKE_HOST_SYSTEM_NAME}.${CMAKE_HOST_SYSTEM_PROCESSOR}.cmake)
# @Intent: Set necessary compiler & linker options for this specific host architecture & OS # @Intent: Set necessary compiler & linker options for this specific host architecture & OS
include(${CMAKE_HOST_SYSTEM_NAME}.${CMAKE_HOST_SYSTEM_PROCESSOR}.cmake) include(${CMAKE_HOST_SYSTEM_NAME}.${CMAKE_HOST_SYSTEM_PROCESSOR}.cmake)

View file

@ -1,7 +1,5 @@
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
set(NSI_DIR ${ZEPHYR_BASE}/scripts/native_simulator)
zephyr_library() zephyr_library()
zephyr_library_compile_definitions(NO_POSIX_CHEATS) zephyr_library_compile_definitions(NO_POSIX_CHEATS)