From 5dd9aaccb4774cafa15fa36ed6ac8451dab6913e Mon Sep 17 00:00:00 2001 From: Janusz Jankowski Date: Wed, 5 Jun 2019 10:27:14 +0200 Subject: [PATCH] cmake: xtensa: use absolute paths for tools CMake has convention of changing relative paths to absolute for CMAKE_* variables. It does it automatically f.e. CMAKE_C_COMPILER. However for our tools like objcopy we have to do it manually. It also helps with integration of CMake in some IDEs. Signed-off-by: Janusz Jankowski --- scripts/cmake/xtensa-toolchain.cmake | 8 ++++---- test/cmocka/cmocka-xtensa-xt-toolchain.cmake | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/cmake/xtensa-toolchain.cmake b/scripts/cmake/xtensa-toolchain.cmake index 48cbd3830..a79fba042 100644 --- a/scripts/cmake/xtensa-toolchain.cmake +++ b/scripts/cmake/xtensa-toolchain.cmake @@ -36,10 +36,10 @@ else() set(CMAKE_C_COMPILER ${CROSS_COMPILE}gcc) endif() -set(CMAKE_LD ${CROSS_COMPILE}ld CACHE STRING "") -set(CMAKE_AR ${CROSS_COMPILE}ar CACHE STRING "") -set(CMAKE_OBJCOPY ${CROSS_COMPILE}objcopy) -set(CMAKE_OBJDUMP ${CROSS_COMPILE}objdump) +find_program(CMAKE_LD NAMES "${CROSS_COMPILE}ld" PATHS ENV PATH NO_DEFAULT_PATH) +find_program(CMAKE_AR NAMES "${CROSS_COMPILE}ar" PATHS ENV PATH NO_DEFAULT_PATH) +find_program(CMAKE_OBJCOPY NAMES "${CROSS_COMPILE}objcopy" PATHS ENV PATH NO_DEFAULT_PATH) +find_program(CMAKE_OBJDUMP NAMES "${CROSS_COMPILE}objdump" PATHS ENV PATH NO_DEFAULT_PATH) set(CMAKE_FIND_ROOT_PATH ".") set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) diff --git a/test/cmocka/cmocka-xtensa-xt-toolchain.cmake b/test/cmocka/cmocka-xtensa-xt-toolchain.cmake index 5571d8fba..81e869aa9 100644 --- a/test/cmocka/cmocka-xtensa-xt-toolchain.cmake +++ b/test/cmocka/cmocka-xtensa-xt-toolchain.cmake @@ -15,10 +15,10 @@ set(CROSS_COMPILE "xt-") set(CMAKE_C_COMPILER ${CROSS_COMPILE}xcc) -set(CMAKE_LD ${CROSS_COMPILE}ld CACHE STRING "") -set(CMAKE_AR ${CROSS_COMPILE}ar CACHE STRING "") -set(CMAKE_OBJCOPY ${CROSS_COMPILE}objcopy) -set(CMAKE_OBJDUMP ${CROSS_COMPILE}objdump) +find_program(CMAKE_LD NAMES "${CROSS_COMPILE}ld" PATHS ENV PATH NO_DEFAULT_PATH) +find_program(CMAKE_AR NAMES "${CROSS_COMPILE}ar" PATHS ENV PATH NO_DEFAULT_PATH) +find_program(CMAKE_OBJCOPY NAMES "${CROSS_COMPILE}objcopy" PATHS ENV PATH NO_DEFAULT_PATH) +find_program(CMAKE_OBJDUMP NAMES "${CROSS_COMPILE}objdump" PATHS ENV PATH NO_DEFAULT_PATH) set(CMAKE_FIND_ROOT_PATH ".") set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)