mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-17 04:31:04 -06:00
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
This commit is contained in:
@@ -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 ")
|
||||
|
||||
Reference in New Issue
Block a user