summaryrefslogtreecommitdiffstats
path: root/Source/cmInstallRuntimeDependencySetGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-03-28 21:28:44 (GMT)
committerBrad King <brad.king@kitware.com>2023-03-29 19:19:47 (GMT)
commit689616785f76acd844fd448c51c5b2a0711aafa2 (patch)
tree203ed92c0b1ccd1d050404db790801192ca6b012 /Source/cmInstallRuntimeDependencySetGenerator.cxx
parentf4b8176447699ba82c2bf7baf2d609d0d6e3259b (diff)
downloadCMake-689616785f76acd844fd448c51c5b2a0711aafa2.zip
CMake-689616785f76acd844fd448c51c5b2a0711aafa2.tar.gz
CMake-689616785f76acd844fd448c51c5b2a0711aafa2.tar.bz2
macOS: Do not pass Apple-specific flags to llvm-strip
Since commit cf82300a63 (BinUtils: Clarify search logic and make it more consistent, 2021-05-27, v3.21.0-rc1~119^2~2) we prefer `llvm-strip` over `strip` when using Clang. However, since commit 20291e8e72 (install: Fix stripping on macOS, 2019-01-30, v3.14.0-rc1~31^2) on macOS we add flags `-u -r`, needed by Apple's `strip` for executables, but that `llvm-strip` does not need or support. Improve the condition to add Apple-specific flags only when the selected `strip` tool is Apple's. Note that Apple dylibs must be stripped with `-x` with either Apple's `strip` or `llvm-strip`. Fixes: #24601
Diffstat (limited to 'Source/cmInstallRuntimeDependencySetGenerator.cxx')
-rw-r--r--Source/cmInstallRuntimeDependencySetGenerator.cxx3
1 files changed, 1 insertions, 2 deletions
diff --git a/Source/cmInstallRuntimeDependencySetGenerator.cxx b/Source/cmInstallRuntimeDependencySetGenerator.cxx
index 44f03e1..1e2e663 100644
--- a/Source/cmInstallRuntimeDependencySetGenerator.cxx
+++ b/Source/cmInstallRuntimeDependencySetGenerator.cxx
@@ -256,8 +256,7 @@ void cmInstallRuntimeDependencySetGenerator::GenerateStripFixup(
if (!strip.empty()) {
os << indent << "if(CMAKE_INSTALL_DO_STRIP)\n"
<< indent.Next() << "execute_process(COMMAND \"" << strip << "\" ";
- if (this->LocalGenerator->GetMakefile()->GetSafeDefinition(
- "CMAKE_HOST_SYSTEM_NAME") == "Darwin") {
+ if (this->LocalGenerator->GetMakefile()->IsOn("APPLE")) {
os << "-x ";
}
os << "\""