summaryrefslogtreecommitdiff
path: root/Modules/Compiler
diff options
context:
space:
mode:
authorIsuru Fernando <isuruf@gmail.com>2019-09-22 12:50:44 -0500
committerIsuru Fernando <isuruf@gmail.com>2019-09-26 19:11:00 -0500
commitb2fd479df595394734ed1a830848cba2f57729f2 (patch)
tree1ee1a48ef15e2dcf5a194f53e03afa34a78bfa31 /Modules/Compiler
parent587ccffe74638676090005ac6b7f799f15a0112c (diff)
downloadcmake-b2fd479df595394734ed1a830848cba2f57729f2.tar.gz
FindBinUtils: Use the compiler to get the path to compiler tools
Fixes: #19728
Diffstat (limited to 'Modules/Compiler')
-rw-r--r--Modules/Compiler/GNU-FindBinUtils.cmake26
1 files changed, 16 insertions, 10 deletions
diff --git a/Modules/Compiler/GNU-FindBinUtils.cmake b/Modules/Compiler/GNU-FindBinUtils.cmake
index 097fbf3ac9..a47b7ad49e 100644
--- a/Modules/Compiler/GNU-FindBinUtils.cmake
+++ b/Modules/Compiler/GNU-FindBinUtils.cmake
@@ -15,21 +15,27 @@ string(REGEX MATCH "^([0-9]+\\.[0-9]+)" __version_x_y
get_filename_component(__gcc_hints "${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER}" DIRECTORY)
# http://manpages.ubuntu.com/manpages/wily/en/man1/gcc-ar.1.html
-find_program(CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_AR NAMES
- "${_CMAKE_TOOLCHAIN_PREFIX}gcc-ar-${__version_x_y}"
- "${_CMAKE_TOOLCHAIN_PREFIX}gcc-ar-${__version_x}"
- "${_CMAKE_TOOLCHAIN_PREFIX}gcc-ar${_CMAKE_COMPILER_SUFFIX}"
- HINTS ${__gcc_hints}
+__get_compiler_component(
+ CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_AR gcc-ar
+ HINTS
+ ${__gcc_hints}
+ NAMES
+ "${_CMAKE_TOOLCHAIN_PREFIX}gcc-ar-${__version_x_y}"
+ "${_CMAKE_TOOLCHAIN_PREFIX}gcc-ar-${__version_x}"
+ "${_CMAKE_TOOLCHAIN_PREFIX}gcc-ar"
DOC "A wrapper around 'ar' adding the appropriate '--plugin' option for the GCC compiler"
)
mark_as_advanced(CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_AR)
# http://manpages.ubuntu.com/manpages/wily/en/man1/gcc-ranlib.1.html
-find_program(CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_RANLIB NAMES
- "${_CMAKE_TOOLCHAIN_PREFIX}gcc-ranlib-${__version_x_y}"
- "${_CMAKE_TOOLCHAIN_PREFIX}gcc-ranlib-${__version_x}"
- "${_CMAKE_TOOLCHAIN_PREFIX}gcc-ranlib${_CMAKE_COMPILER_SUFFIX}"
- HINTS ${__gcc_hints}
+__get_compiler_component(
+ CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_RANLIB gcc-ranlib
+ HINTS
+ ${__gcc_hints}
+ NAMES
+ "${_CMAKE_TOOLCHAIN_PREFIX}gcc-ranlib-${__version_x_y}"
+ "${_CMAKE_TOOLCHAIN_PREFIX}gcc-ranlib-${__version_x}"
+ "${_CMAKE_TOOLCHAIN_PREFIX}gcc-ranlib"
DOC "A wrapper around 'ranlib' adding the appropriate '--plugin' option for the GCC compiler"
)
mark_as_advanced(CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_RANLIB)