From bab3a2562eda61765a4ed9cac3f8e291e982c1e8 Mon Sep 17 00:00:00 2001 From: Torsten Rasmussen Date: Thu, 2 Jul 2020 13:15:57 +0200 Subject: [PATCH] xtensa: changing $ENV{ZEPHYR_SDK_INSTALL_DIR} to CMake var ZEPHYR_SDK_INSTALL_DIR will be set as an internal CMake variable when using the Zephyr SDK. The Zephyr SDK zephyr/host-tools.cmake will ensure to set the CMake ZEPHYR_SDK_INSTALL_DIR variable to the environment setting, or the install directory in case the CMake package was used. Users not using the environment variable will experience the following error: ``` Linking C executable zephyr/.../bootloader/bootloader.elf FAILED: zephyr/.../bootloader/bootloader.elf /xtensa-zephyr-elf/bin/ld: cannot find -lhal ``` This commit ensures code build correctly both when setting the environment variable ZEPHYR_SDK_INSTALL_DIR, and when using Zephyr SDK CMake `find_package(Zephyr-sdk)` Signed-off-by: Torsten Rasmussen --- soc/xtensa/intel_apl_adsp/common/bootloader/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/soc/xtensa/intel_apl_adsp/common/bootloader/CMakeLists.txt b/soc/xtensa/intel_apl_adsp/common/bootloader/CMakeLists.txt index 674e2f621f5..8d0f85a2721 100644 --- a/soc/xtensa/intel_apl_adsp/common/bootloader/CMakeLists.txt +++ b/soc/xtensa/intel_apl_adsp/common/bootloader/CMakeLists.txt @@ -23,7 +23,7 @@ add_executable(bootloader add_dependencies(bootloader ${SYSCALL_LIST_H_TARGET}) -set(zephyr_sdk $ENV{ZEPHYR_SDK_INSTALL_DIR}) +set(zephyr_sdk ${ZEPHYR_SDK_INSTALL_DIR}) target_include_directories(bootloader PUBLIC ./