From 232b4b0a7a94d43b95b37a6cedc47d425f9673da Mon Sep 17 00:00:00 2001 From: Alberto Escolar Piedras Date: Wed, 2 Aug 2023 14:46:27 +0200 Subject: [PATCH] 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 --- arch/posix/CMakeLists.txt | 2 ++ boards/posix/native_sim/CMakeLists.txt | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/posix/CMakeLists.txt b/arch/posix/CMakeLists.txt index 635e5a630a6..7262272fb88 100644 --- a/arch/posix/CMakeLists.txt +++ b/arch/posix/CMakeLists.txt @@ -27,6 +27,8 @@ endif() # We use target_link_options() instead 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) # @Intent: Set necessary compiler & linker options for this specific host architecture & OS include(${CMAKE_HOST_SYSTEM_NAME}.${CMAKE_HOST_SYSTEM_PROCESSOR}.cmake) diff --git a/boards/posix/native_sim/CMakeLists.txt b/boards/posix/native_sim/CMakeLists.txt index db81d1ad103..5ce0a977745 100644 --- a/boards/posix/native_sim/CMakeLists.txt +++ b/boards/posix/native_sim/CMakeLists.txt @@ -1,7 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -set(NSI_DIR ${ZEPHYR_BASE}/scripts/native_simulator) - zephyr_library() zephyr_library_compile_definitions(NO_POSIX_CHEATS)