Skip to content

Commit

Permalink
native_sim build: Fix for APPLICATION_BINARY_DIR!=CMAKE_BINARY_DIR
Browse files Browse the repository at this point in the history
In some cases, the APPLICATION_BINARY_DIR does not match
the CMAKE_BINARY_DIR, in those cases the native simulator
build would not find the zephyr elf file.
Fix it by using the correct variable.

Signed-off-by: Alberto Escolar Piedras <[email protected]>
  • Loading branch information
aescolar authored and carlescufi committed Nov 17, 2023
1 parent 19d250e commit bc08e80
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1762,7 +1762,7 @@ if(CONFIG_BUILD_OUTPUT_EXE)
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
-r NSI_CONFIG_FILE=${APPLICATION_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}
Expand Down
2 changes: 1 addition & 1 deletion boards/posix/common/natsim_config.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (c) 2023 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0

set(zephyr_build_path ${CMAKE_BINARY_DIR}/zephyr)
set(zephyr_build_path ${APPLICATION_BINARY_DIR}/zephyr)
get_property(CCACHE GLOBAL PROPERTY RULE_LAUNCH_COMPILE)

target_link_options(native_simulator INTERFACE
Expand Down

0 comments on commit bc08e80

Please sign in to comment.