Commit Graph

6 Commits

Author SHA1 Message Date
Gregor Jasny e8bafb6fcb OS X: Do not try to set deployment target when cross-compiling
The change in commit v3.4.0-rc2~6^2 (Xcode: Adjust deployment target SDK
version to host version, 2015-10-11) does not make sense when
cross-compiling.  Make it conditional to fix this regression in some
cross-compiling cases.

Closes: #16355
2016-10-17 10:02:17 -04:00
Gregor Jasny 540815eec2 Xcode: Convert maybe unversioned OSX sysroot into versioned SDK path
Starting with Xcode 8 the SDK folder also contains an unversioned
entry:

$ ls -l /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs

drwxr-xr-x  5 root  wheel  170 Mar  4  2018 MacOSX.sdk
lrwxr-xr-x  1 root  wheel   10 Sep 16 20:49 MacOSX10.12.sdk -> MacOSX.sdk

If this unversioned path is used CMake cannot detect the SDK
version. To work around the problem we always invoke the code path
that translates short SDK names like "macosx10.12" into a path.
That way we always end up with a versioned SDK path in
_CMAKE_OSX_SYSROOT_PATH which is later used to determine the version.

Closes: #16323
2016-09-25 13:06:23 +02:00
Brad King cffe0ed798 OS X: Drop warning about SDK and deployment target version mismatch
OS X supports using the SDK for any version equal to or newer than
the deployment target.  There is no reason to warn if the versions
do not match exactly.

Suggested-by: James Burgess <jamesrburgess@mac.com>
Suggested-by: Clinton Stimpson <clinton@elemtech.com>
2016-05-26 09:20:28 -04:00
Gregor Jasny 24aafbde11 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.
2015-10-12 15:31:10 -04:00
Clinton Stimpson 5dfe9b7d5a Xcode: Find fallback SDK if one matching the OS version doesn't exist.
For example if one installs Xcode 4.6 on OS X 10.9, it doesn't contain
a 10.9 SDK, so fallback to the next newest version which, in this case,
happens to be a 10.8 SDK.

This fixes bug #14572.
2014-05-06 09:18:00 -06:00
Brad King 0200d0a9c4 OS X: Factor a Darwin-Initialize module out of Platform/Darwin
Initialize variables CMAKE_OSX_SYSROOT, CMAKE_OSX_DEPLOYMENT_TARGET, and
CMAKE_OSX_ARCHITECTURES prior to enabling any languages.  This will
allow compiler identification to consider these values.
2014-04-29 09:36:14 -04:00