From 050b8a915c3b0300f51d274f1ae56db41cd6cab7 Mon Sep 17 00:00:00 2001 From: Ederson de Souza Date: Tue, 6 May 2025 17:33:39 -0700 Subject: [PATCH] cmake/emu: Use SIMICS_PROJECT environment variable as working dir Some simics dependencies live at its own directory, not application's. Note we need to change it to its absolute path, because relative paths for `add_custom_target` are relative to the build directory, while relative SIMICS_PROJECT are more likely to be relative to ZEPHYR_BASE, from where west or twister are normally run. Signed-off-by: Ederson de Souza --- cmake/emu/simics.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmake/emu/simics.cmake b/cmake/emu/simics.cmake index 1c5cc3f96ea..5c5c7b82694 100644 --- a/cmake/emu/simics.cmake +++ b/cmake/emu/simics.cmake @@ -24,6 +24,8 @@ else() get_property(SIMICS_ARGS GLOBAL PROPERTY "BOARD_EMU_ARGS_simics") + file(REAL_PATH $ENV{SIMICS_PROJECT} simics_project_dir_real) + add_custom_target(run_simics COMMAND ${SIMICS} @@ -34,7 +36,7 @@ else() ${SIMICS_ARGS} $ENV{SIMICS_EXTRA_ARGS} -e run - WORKING_DIRECTORY ${APPLICATION_BINARY_DIR} + WORKING_DIRECTORY ${simics_project_dir_real} DEPENDS ${logical_target_for_zephyr_elf} USES_TERMINAL )