From 52295a605f1972f8966ab3d1b3e26666381d9168 Mon Sep 17 00:00:00 2001 From: Manu3l0us Date: Thu, 26 Sep 2024 13:56:42 +0200 Subject: [PATCH] Set correct OPENOCD_DEFAULT_PATH for Windows On Windows platform, the OPENOCD_DEFAULT_PATH is not set in line with Zephyr documentation. Fixes zephyrproject-rtos/zephyr#79051. Signed-off-by: Manuel Aebischer --- cmake/zephyr/host-tools.cmake | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmake/zephyr/host-tools.cmake b/cmake/zephyr/host-tools.cmake index 8cfdf482..e8ba7d68 100644 --- a/cmake/zephyr/host-tools.cmake +++ b/cmake/zephyr/host-tools.cmake @@ -10,4 +10,8 @@ list(APPEND CMAKE_PREFIX_PATH ${HOST_TOOLS_HOME}/usr) # TODO: Use find_* somehow for these as well? set_ifndef(QEMU_BIOS ${HOST_TOOLS_HOME}/usr/share/qemu) -set_ifndef(OPENOCD_DEFAULT_PATH ${HOST_TOOLS_HOME}/usr/share/openocd/scripts) +if (WIN32) + set_ifndef(OPENOCD_DEFAULT_PATH $ENV{ProgramFiles}/OpenOCD/share/openocd/scripts) +else () + set_ifndef(OPENOCD_DEFAULT_PATH ${HOST_TOOLS_HOME}/usr/share/openocd/scripts) +endif ()