summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
Diffstat (limited to 'Modules')
-rw-r--r--Modules/CMakeFindBinUtils.cmake13
1 files changed, 13 insertions, 0 deletions
diff --git a/Modules/CMakeFindBinUtils.cmake b/Modules/CMakeFindBinUtils.cmake
index de9ef9a..b2004f1 100644
--- a/Modules/CMakeFindBinUtils.cmake
+++ b/Modules/CMakeFindBinUtils.cmake
@@ -102,6 +102,19 @@ else()
set(_CMAKE_ADDITIONAL_ADDR2LINE_NAMES "llvm-addr2line")
endif()
+ if(NOT CMAKE_CROSSCOMPILING AND NOT "${_CMAKE_TOOLCHAIN_PREFIX}" STREQUAL "")
+ list(APPEND _CMAKE_ADDITIONAL_AR_NAMES "ar")
+ list(APPEND _CMAKE_ADDITIONAL_RANLIB_NAMES "ranlib")
+ list(APPEND _CMAKE_ADDITIONAL_STRIP_NAMES "strip")
+ list(APPEND _CMAKE_ADDITIONAL_LINKER_NAMES "ld")
+ list(APPEND _CMAKE_ADDITIONAL_NM_NAMES "nm")
+ list(APPEND _CMAKE_ADDITIONAL_OBJDUMP_NAMES "objdump")
+ list(APPEND _CMAKE_ADDITIONAL_OBJCOPY_NAMES "objcopy")
+ list(APPEND _CMAKE_ADDITIONAL_READELF_NAMES "readelf")
+ list(APPEND _CMAKE_ADDITIONAL_DLLTOOL_NAMES "dlltool")
+ list(APPEND _CMAKE_ADDITIONAL_ADDR2LINE_NAMES "addr2line")
+ endif()
+
find_program(CMAKE_AR NAMES ${_CMAKE_TOOLCHAIN_PREFIX}ar${_CMAKE_TOOLCHAIN_SUFFIX} ${_CMAKE_ADDITIONAL_AR_NAMES} HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
find_program(CMAKE_RANLIB NAMES ${_CMAKE_TOOLCHAIN_PREFIX}ranlib ${_CMAKE_ADDITIONAL_RANLIB_NAMES} HINTS ${_CMAKE_TOOLCHAIN_LOCATION})