diff options
author | Evan Miller <emmiller@gmail.com> | 2021-08-02 19:38:02 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2021-08-02 20:12:14 (GMT) |
commit | 1af23c4de2c7d58c06171d70b37794b5c860d5f4 (patch) | |
tree | 3c03d8de6e561b29eda830dce3ee4f8edcd2889b /Modules/Platform | |
parent | 9029335b526767b50a6f3d06fc04a2ab7de7a381 (diff) | |
download | CMake-1af23c4de2c7d58c06171d70b37794b5c860d5f4.zip CMake-1af23c4de2c7d58c06171d70b37794b5c860d5f4.tar.gz CMake-1af23c4de2c7d58c06171d70b37794b5c860d5f4.tar.bz2 |
macOS: Restore support for Mac OS X 10.4 (Tiger)
Since commit 4aed96e230 (Apple: Set CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG
on non-macOS too, 2021-04-06, v3.20.1~5^2) we always enable support for
linking with `-rpath`. The intention of the change was to enable using
the flag on iOS, tvOS and watchOS by avoiding a Darwin-specific version
check. However, removing the check broke support for OS X 10.4 because
the flag is not supported on that version.
Restore a form of the check that disables the flag on OS X < 10.5 while
still allowing it for the other Apple platforms. Since no one is doing
iOS/tvOS/etc development on 10.4, this change should have no unintended
side effects.
Fixes: #22490
Diffstat (limited to 'Modules/Platform')
-rw-r--r-- | Modules/Platform/Darwin.cmake | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Modules/Platform/Darwin.cmake b/Modules/Platform/Darwin.cmake index d9a7894..839dc81 100644 --- a/Modules/Platform/Darwin.cmake +++ b/Modules/Platform/Darwin.cmake @@ -47,7 +47,9 @@ set(CMAKE_SHARED_MODULE_PREFIX "lib") set(CMAKE_SHARED_MODULE_SUFFIX ".so") set(CMAKE_MODULE_EXISTS 1) set(CMAKE_DL_LIBS "") -set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,") +if(NOT "${_CURRENT_OSX_VERSION}" VERSION_LESS "10.5") + set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,") +endif() foreach(lang C CXX OBJC OBJCXX) set(CMAKE_${lang}_OSX_COMPATIBILITY_VERSION_FLAG "-compatibility_version ") |