diff options
author | Isuru Fernando <isuruf@gmail.com> | 2019-09-22 17:50:44 (GMT) |
---|---|---|
committer | Isuru Fernando <isuruf@gmail.com> | 2019-09-27 00:11:00 (GMT) |
commit | b2fd479df595394734ed1a830848cba2f57729f2 (patch) | |
tree | 1ee1a48ef15e2dcf5a194f53e03afa34a78bfa31 /Modules/Compiler | |
parent | 587ccffe74638676090005ac6b7f799f15a0112c (diff) | |
download | CMake-b2fd479df595394734ed1a830848cba2f57729f2.zip CMake-b2fd479df595394734ed1a830848cba2f57729f2.tar.gz CMake-b2fd479df595394734ed1a830848cba2f57729f2.tar.bz2 |
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.cmake | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/Modules/Compiler/GNU-FindBinUtils.cmake b/Modules/Compiler/GNU-FindBinUtils.cmake index 097fbf3..a47b7ad 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) |