diff options
author | Brad King <brad.king@kitware.com> | 2023-06-07 10:27:37 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2023-06-07 11:02:20 (GMT) |
commit | e4c53cdc15bdec51ae4371702b0ab266ee2c46be (patch) | |
tree | 787a9c33d6bef570cb0be5c560d10aebe25a3355 | |
parent | 1373373823ccaf8378a19a95685337061d79d5b1 (diff) | |
download | CMake-e4c53cdc15bdec51ae4371702b0ab266ee2c46be.zip CMake-e4c53cdc15bdec51ae4371702b0ab266ee2c46be.tar.gz CMake-e4c53cdc15bdec51ae4371702b0ab266ee2c46be.tar.bz2 |
BinUtils: Drop now-unnecessary cross-compiling workaround for Apple hosts
Previously we added fallbacks to `llvm-{ar,strip}` on Apple hosts
in case of cross-compiling because the `APPLE` platform variable
was not set w.r.t. the target platform. The platform variable
has been fixed, so remove the fallbacks.
Issue: #23333
-rw-r--r-- | Modules/CMakeFindBinUtils.cmake | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/Modules/CMakeFindBinUtils.cmake b/Modules/CMakeFindBinUtils.cmake index 461839a..327ef0b 100644 --- a/Modules/CMakeFindBinUtils.cmake +++ b/Modules/CMakeFindBinUtils.cmake @@ -179,25 +179,15 @@ else() elseif(NOT APPLE) list(PREPEND _CMAKE_LINKER_NAMES "ld.lld") endif() - 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() + # llvm-ar does not generate a symbol table that the Apple ld64 linker accepts. + if(NOT APPLE) list(PREPEND _CMAKE_AR_NAMES "llvm-ar") endif() list(PREPEND _CMAKE_RANLIB_NAMES "llvm-ranlib") + # llvm-strip versions prior to 11 require additional flags we do not yet add. if("${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_VERSION}" VERSION_GREATER_EQUAL 11) - # llvm-strip versions prior to 11 require additional flags we do not yet add. - if(APPLE) - # llvm-strip does not seem to support chained fixup format correctly. - # FIXME(#23333): We still need to consider 'llvm-strip' as a fallback - # because the 'APPLE' definition may be based on the host in this context, - # and a cross-compiling toolchain may not have 'strip'. - list(APPEND _CMAKE_STRIP_NAMES "llvm-strip") - else() + # llvm-strip does not seem to support chained fixup format on macOS correctly. + if(NOT APPLE) list(PREPEND _CMAKE_STRIP_NAMES "llvm-strip") endif() endif() |