summaryrefslogtreecommitdiffstats
path: root/Modules/Compiler
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-08-16 14:47:04 (GMT)
committerKitware Robot <kwrobot@kitware.com>2017-08-16 14:47:10 (GMT)
commit867b0611539de7204521205df59947d7abfc2ed4 (patch)
treeefc6f65794cdd9bc1e861659405e15846d28170e /Modules/Compiler
parent472acc890f368773a92ba52d326f0a8770aae020 (diff)
parent630235bd9e049a8da47c05b1b82790272e22c834 (diff)
downloadCMake-867b0611539de7204521205df59947d7abfc2ed4.zip
CMake-867b0611539de7204521205df59947d7abfc2ed4.tar.gz
CMake-867b0611539de7204521205df59947d7abfc2ed4.tar.bz2
Merge topic 'debian_clang_binutils'
630235bd Clang: Find version-suffixed LLVM/Clang binutils Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1127
Diffstat (limited to 'Modules/Compiler')
-rw-r--r--Modules/Compiler/Clang-FindBinUtils.cmake8
1 files changed, 8 insertions, 0 deletions
diff --git a/Modules/Compiler/Clang-FindBinUtils.cmake b/Modules/Compiler/Clang-FindBinUtils.cmake
index e2822a1..b852660 100644
--- a/Modules/Compiler/Clang-FindBinUtils.cmake
+++ b/Modules/Compiler/Clang-FindBinUtils.cmake
@@ -2,6 +2,12 @@ if(NOT DEFINED _CMAKE_PROCESSING_LANGUAGE OR _CMAKE_PROCESSING_LANGUAGE STREQUAL
message(FATAL_ERROR "Internal error: _CMAKE_PROCESSING_LANGUAGE is not set")
endif()
+# Debian:
+# * /usr/bin/llvm-ar-4.0
+# * /usr/bin/llvm-ranlib-4.0
+string(REGEX MATCH "^([0-9]+\\.[0-9]+)" __version_x_y
+ "${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_VERSION}")
+
# Try to find tools in the same directory as Clang itself
get_filename_component(__clang_hint_1 "${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER}" REALPATH)
get_filename_component(__clang_hint_1 "${__clang_hint_1}" DIRECTORY)
@@ -12,6 +18,7 @@ set(__clang_hints ${__clang_hint_1} ${__clang_hint_2})
# http://manpages.ubuntu.com/manpages/precise/en/man1/llvm-ar.1.html
find_program(CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_AR NAMES
+ "${_CMAKE_TOOLCHAIN_PREFIX}llvm-ar-${__version_x_y}"
"${_CMAKE_TOOLCHAIN_PREFIX}llvm-ar"
HINTS ${__clang_hints}
DOC "LLVM archiver"
@@ -20,6 +27,7 @@ mark_as_advanced(CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_AR)
# http://manpages.ubuntu.com/manpages/precise/en/man1/llvm-ranlib.1.html
find_program(CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_RANLIB NAMES
+ "${_CMAKE_TOOLCHAIN_PREFIX}llvm-ranlib-${__version_x_y}"
"${_CMAKE_TOOLCHAIN_PREFIX}llvm-ranlib"
HINTS ${__clang_hints}
DOC "Generate index for LLVM archive"