summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGregor Jasny <gjasny@googlemail.com>2015-10-11 10:07:25 (GMT)
committerBrad King <brad.king@kitware.com>2015-10-12 19:31:10 (GMT)
commit24aafbde115647b7e599d112d0bcc4f03c3e9b88 (patch)
tree6788254908cc76f95a6f5c13747a224ceab25370
parent679a5d2185b15dcd0ff73f7c1c2d7d527c53de53 (diff)
downloadCMake-24aafbde115647b7e599d112d0bcc4f03c3e9b88.zip
CMake-24aafbde115647b7e599d112d0bcc4f03c3e9b88.tar.gz
CMake-24aafbde115647b7e599d112d0bcc4f03c3e9b88.tar.bz2
Xcode: Adjust deployment target SDK version to host version
If the automatically selected SDK is newer than the host OS version and no deployment version has been set then adjust the deployment version to the host OS version. Otherwise the user won't be able to launch the executables on the build host. This is for example a problem on a MacOSX 10.10 host with Xcode 7 which only provides a MacOSX10.11 SDK.
-rw-r--r--Modules/Platform/Darwin-Initialize.cmake4
1 files changed, 4 insertions, 0 deletions
diff --git a/Modules/Platform/Darwin-Initialize.cmake b/Modules/Platform/Darwin-Initialize.cmake
index 62fb985..a08411b 100644
--- a/Modules/Platform/Darwin-Initialize.cmake
+++ b/Modules/Platform/Darwin-Initialize.cmake
@@ -100,6 +100,10 @@ elseif("${CMAKE_GENERATOR}" MATCHES Xcode
"Instead using SDK:\n \"${_CMAKE_OSX_SYSROOT_DEFAULT}\"."
)
endif()
+ if(NOT CMAKE_OSX_DEPLOYMENT_TARGET AND _CURRENT_OSX_VERSION VERSION_LESS _CMAKE_OSX_DEPLOYMENT_TARGET)
+ set(CMAKE_OSX_DEPLOYMENT_TARGET ${_CURRENT_OSX_VERSION} CACHE STRING
+ "Minimum OS X version to target for deployment (at runtime); newer APIs weak linked. Set to empty string for default value." FORCE)
+ endif()
else()
# Assume developer files are in root (such as Xcode 4.5 command-line tools).
set(_CMAKE_OSX_SYSROOT_DEFAULT "")