summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-03-16 15:09:38 (GMT)
committerKitware Robot <kwrobot@kitware.com>2022-03-16 15:09:44 (GMT)
commit1925a5ccc256cbe8585983a0127645f02bb9337b (patch)
tree400c37123ebb6bf819a2a00acc81877ea480ca87 /Modules
parent790c225208d389b332828014b55894e9f9c5d0e8 (diff)
parentfee36b7a784543c3d89e2ef7c531e6892116f237 (diff)
downloadCMake-1925a5ccc256cbe8585983a0127645f02bb9337b.zip
CMake-1925a5ccc256cbe8585983a0127645f02bb9337b.tar.gz
CMake-1925a5ccc256cbe8585983a0127645f02bb9337b.tar.bz2
Merge topic 'binutils-llvm-ar-apple' into release-3.23
fee36b7a78 BinUtils: Restore llvm-ar fallback on Apple platforms Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !7077
Diffstat (limited to 'Modules')
-rw-r--r--Modules/CMakeFindBinUtils.cmake7
1 files changed, 6 insertions, 1 deletions
diff --git a/Modules/CMakeFindBinUtils.cmake b/Modules/CMakeFindBinUtils.cmake
index 16d3106..a6bd0d1 100644
--- a/Modules/CMakeFindBinUtils.cmake
+++ b/Modules/CMakeFindBinUtils.cmake
@@ -173,8 +173,13 @@ else()
else()
list(PREPEND _CMAKE_LINKER_NAMES "ld.lld")
endif()
- if(NOT APPLE)
+ if(APPLE)
# llvm-ar does not generate a symbol table that the Apple ld64 linker accepts.
+ # FIXME(#23333): We still need to consider 'llvm-ar' as a fallback because
+ # the 'APPLE' definition may be based on the host in this context, and a
+ # cross-compiling toolchain may not have 'ar'.
+ list(APPEND _CMAKE_AR_NAMES "llvm-ar")
+ else()
list(PREPEND _CMAKE_AR_NAMES "llvm-ar")
endif()
list(PREPEND _CMAKE_RANLIB_NAMES "llvm-ranlib")