summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Miller <emmiller@gmail.com>2021-08-02 15:38:02 -0400
committerBrad King <brad.king@kitware.com>2021-08-02 16:12:14 -0400
commit1af23c4de2c7d58c06171d70b37794b5c860d5f4 (patch)
tree3c03d8de6e561b29eda830dce3ee4f8edcd2889b
parent9029335b526767b50a6f3d06fc04a2ab7de7a381 (diff)
downloadcmake-1af23c4de2c7d58c06171d70b37794b5c860d5f4.tar.gz
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
-rw-r--r--Modules/Platform/Darwin.cmake4
1 files changed, 3 insertions, 1 deletions
diff --git a/Modules/Platform/Darwin.cmake b/Modules/Platform/Darwin.cmake
index d9a789475c..839dc814ec 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 ")