summaryrefslogtreecommitdiffstats
path: root/Modules/Compiler
diff options
context:
space:
mode:
authorDan McGregor <dan.mcgregor@usask.ca>2023-05-08 23:06:14 (GMT)
committerDan McGregor <dan.mcgregor@usask.ca>2023-05-09 00:09:27 (GMT)
commit6a82852dc219380d519138590181b6abd45bd4a1 (patch)
tree33f15e465e467597a9ae1fc5edc4f59392162414 /Modules/Compiler
parentb2d689bc5abf027e6650cb8d68c9859249a0ea6f (diff)
downloadCMake-6a82852dc219380d519138590181b6abd45bd4a1.zip
CMake-6a82852dc219380d519138590181b6abd45bd4a1.tar.gz
CMake-6a82852dc219380d519138590181b6abd45bd4a1.tar.bz2
Allow toolchain suffix without leading dash
FreeBSD installs both LLVM and gcc with tools named after the major version, in the form "clang<major>", such as "clang16". Detect compilers named this way, and find the related toolchain tools.
Diffstat (limited to 'Modules/Compiler')
-rw-r--r--Modules/Compiler/Clang-FindBinUtils.cmake3
-rw-r--r--Modules/Compiler/GNU-FindBinUtils.cmake2
2 files changed, 5 insertions, 0 deletions
diff --git a/Modules/Compiler/Clang-FindBinUtils.cmake b/Modules/Compiler/Clang-FindBinUtils.cmake
index daf0371..f4f35e6 100644
--- a/Modules/Compiler/Clang-FindBinUtils.cmake
+++ b/Modules/Compiler/Clang-FindBinUtils.cmake
@@ -26,6 +26,7 @@ set(__clang_hints ${__clang_hint_1} ${__clang_hint_2})
find_program(CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_AR NAMES
"${_CMAKE_TOOLCHAIN_PREFIX}llvm-ar-${__version_x_y}"
"${_CMAKE_TOOLCHAIN_PREFIX}llvm-ar-${__version_x}"
+ "${_CMAKE_TOOLCHAIN_PREFIX}llvm-ar${__version_x}"
"${_CMAKE_TOOLCHAIN_PREFIX}llvm-ar"
HINTS ${__clang_hints}
NO_CMAKE_PATH NO_CMAKE_ENVIRONMENT_PATH
@@ -37,6 +38,7 @@ mark_as_advanced(CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_AR)
find_program(CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_RANLIB NAMES
"${_CMAKE_TOOLCHAIN_PREFIX}llvm-ranlib-${__version_x_y}"
"${_CMAKE_TOOLCHAIN_PREFIX}llvm-ranlib-${__version_x}"
+ "${_CMAKE_TOOLCHAIN_PREFIX}llvm-ranlib${__version_x}"
"${_CMAKE_TOOLCHAIN_PREFIX}llvm-ranlib"
HINTS ${__clang_hints}
NO_CMAKE_PATH NO_CMAKE_ENVIRONMENT_PATH
@@ -48,6 +50,7 @@ mark_as_advanced(CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_RANLIB)
find_program(CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_CLANG_SCAN_DEPS NAMES
"${_CMAKE_TOOLCHAIN_PREFIX}clang-scan-deps-${__version_x_y}"
"${_CMAKE_TOOLCHAIN_PREFIX}clang-scan-deps-${__version_x}"
+ "${_CMAKE_TOOLCHAIN_PREFIX}clang-scan-deps${__version_x}"
"${_CMAKE_TOOLCHAIN_PREFIX}clang-scan-deps"
HINTS ${__clang_hints}
NO_CMAKE_PATH NO_CMAKE_ENVIRONMENT_PATH
diff --git a/Modules/Compiler/GNU-FindBinUtils.cmake b/Modules/Compiler/GNU-FindBinUtils.cmake
index 4dcdd53..3941715 100644
--- a/Modules/Compiler/GNU-FindBinUtils.cmake
+++ b/Modules/Compiler/GNU-FindBinUtils.cmake
@@ -18,6 +18,7 @@ get_filename_component(__gcc_hints "${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPIL
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${__version_x}"
"${_CMAKE_TOOLCHAIN_PREFIX}gcc-ar${_CMAKE_COMPILER_SUFFIX}"
HINTS ${__gcc_hints}
NO_CMAKE_PATH NO_CMAKE_ENVIRONMENT_PATH
@@ -29,6 +30,7 @@ mark_as_advanced(CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_AR)
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${__version_x}"
"${_CMAKE_TOOLCHAIN_PREFIX}gcc-ranlib${_CMAKE_COMPILER_SUFFIX}"
HINTS ${__gcc_hints}
NO_CMAKE_PATH NO_CMAKE_ENVIRONMENT_PATH