diff options
author | Brad King <brad.king@kitware.com> | 2020-08-19 15:35:00 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-08-19 15:35:00 (GMT) |
commit | 09e8de75d5997ad2a57049426c5dc3b9238e2d34 (patch) | |
tree | 3cf76fbf725b807a1be8010237bc617c2f8ba584 /Modules | |
parent | acd15bf146616517df7ac7f55f9c270657cad0d5 (diff) | |
parent | 6896e50967c65ec648c07ba61c796d6660929a91 (diff) | |
download | CMake-09e8de75d5997ad2a57049426c5dc3b9238e2d34.zip CMake-09e8de75d5997ad2a57049426c5dc3b9238e2d34.tar.gz CMake-09e8de75d5997ad2a57049426c5dc3b9238e2d34.tar.bz2 |
Merge topic 'CMakeFindBinUtils-fallback' into release-3.18
6896e50967 CMakeFindBinUtils: Always consider plain binutils when not cross-compiling
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5137
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/CMakeFindBinUtils.cmake | 13 |
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}) |