mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 05:40:54 -06:00
Merge topic 'xcode-macos-deployment-target'
de53a46a91Help: Add 4.1 release note for restored Xcode default deployment target85ba6f5d1bMerge branch 'backport-4.0-xcode-macos-deployment-target'884260ced6Help: Add 4.0 release note for restored Xcode default deployment target1a37c83c7eXcode: Restore default CMAKE_OSX_DEPLOYMENT_TARGET to run on hoste927408047Apple: Initialize deployment target after SDK Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !11361
This commit is contained in:
@@ -1,15 +1,39 @@
|
||||
CMAKE_OSX_DEPLOYMENT_TARGET
|
||||
---------------------------
|
||||
|
||||
Specify the minimum version of the target platform (e.g. macOS or iOS)
|
||||
on which the target binaries are to be deployed. CMake uses this
|
||||
variable value for the ``-mmacosx-version-min`` flag or their respective
|
||||
target platform equivalents. For older Xcode versions that shipped
|
||||
multiple macOS SDKs this variable also helps to choose the SDK in case
|
||||
:variable:`CMAKE_OSX_SYSROOT` is unset.
|
||||
Specify the minimum version of the target platform, e.g., macOS or iOS,
|
||||
on which the target binaries are to be deployed.
|
||||
|
||||
If not set explicitly the value is initialized by the
|
||||
``MACOSX_DEPLOYMENT_TARGET`` environment variable, if set,
|
||||
and otherwise computed based on the host platform.
|
||||
For builds targeting macOS (:variable:`CMAKE_SYSTEM_NAME` is ``Darwin``), if
|
||||
``CMAKE_OSX_DEPLOYMENT_TARGET`` is not explicitly set, a default is set:
|
||||
|
||||
* If the ``MACOSX_DEPLOYMENT_TARGET`` environment variable is non-empty,
|
||||
its value is the default.
|
||||
|
||||
* Otherwise, if using the :generator:`Xcode` generator, and the host's
|
||||
macOS version is older than the macOS SDK (:variable:`CMAKE_OSX_SYSROOT`,
|
||||
if set, or Xcode's default SDK), the host's macOS version is the default.
|
||||
|
||||
.. versionchanged:: 4.0
|
||||
|
||||
Previously this was done for all generators, not just Xcode.
|
||||
|
||||
* Otherwise, the default is empty.
|
||||
|
||||
The effects of ``CMAKE_OSX_DEPLOYMENT_TARGET`` depend on the generator:
|
||||
|
||||
:generator:`Xcode`
|
||||
|
||||
If ``CMAKE_OSX_DEPLOYMENT_TARGET`` is set to a non-empty value, it is added
|
||||
to the generated Xcode project as the ``MACOSX_DEPLOYMENT_TARGET`` setting.
|
||||
Otherwise, no such setting is added, so Xcode's default deployed target is
|
||||
used, typically based on the SDK version.
|
||||
|
||||
Other Generators
|
||||
|
||||
If ``CMAKE_OSX_DEPLOYMENT_TARGET`` is set to a non-empty value, it is passed
|
||||
to the compiler via the ``-mmacosx-version-min`` flag or equivalent.
|
||||
Otherwise, no such flag is added, so the compiler's default deployment
|
||||
target is used.
|
||||
|
||||
.. include:: include/CMAKE_OSX_VARIABLE.rst
|
||||
|
||||
Reference in New Issue
Block a user