diff options
author | Brad King <brad.king@kitware.com> | 2023-11-19 16:47:22 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2023-11-19 16:47:37 (GMT) |
commit | 1f7a653e90e2e037867a4121c9edd2bd04997cbd (patch) | |
tree | 1e0e21481343a1599d9b4ca934750b808eb02b01 /Help/variable | |
parent | 67be468693c19cdc5377d0d090c055d58f484ed2 (diff) | |
parent | 0f80101b73c175dd0272097a5ef9d58f7c35b093 (diff) | |
download | CMake-1f7a653e90e2e037867a4121c9edd2bd04997cbd.zip CMake-1f7a653e90e2e037867a4121c9edd2bd04997cbd.tar.gz CMake-1f7a653e90e2e037867a4121c9edd2bd04997cbd.tar.bz2 |
Merge topic 'swift-compilation-mode'
0f80101b73 Tests: Update Swift tests to use CMP0157 NEW behavior
c1d787e473 Swift: Add abstraction for compilation mode
c39384f540 Tests: Simplify RunCMake.Swift conditions to enable use of Swift
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8918
Diffstat (limited to 'Help/variable')
-rw-r--r-- | Help/variable/CMAKE_Swift_COMPILATION_MODE.rst | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/Help/variable/CMAKE_Swift_COMPILATION_MODE.rst b/Help/variable/CMAKE_Swift_COMPILATION_MODE.rst new file mode 100644 index 0000000..5e55d8c --- /dev/null +++ b/Help/variable/CMAKE_Swift_COMPILATION_MODE.rst @@ -0,0 +1,32 @@ +CMAKE_Swift_COMPILATION_MODE +---------------------------- + +.. versionadded:: 3.29 + +Specify how Swift compiles a target. This variable is used to initialize the +:prop_tgt:`Swift_COMPILATION_MODE` property on targets as they are created. + +The allowed values are: + +.. include:: ../prop_tgt/Swift_COMPILATION_MODE-VALUES.txt + +Use :manual:`generator expressions <cmake-generator-expressions(7)>` to support +per-configuration specification. For example, the code: + +.. code-block:: cmake + + set(CMAKE_Swift_COMPILATION_MODE + "$<IF:$<CONFIG:Release>,wholemodule,incremental>") + +sets the default Swift compilation mode to wholemodule mode when building a +release configuration and to incremental mode in other configurations. + +If this variable is not set then the :prop_tgt:`Swift_COMPILATION_MODE` target +property will not be set automatically. If that property is unset then CMake +uses the default value ``incremental`` to build the Swift source files. + +.. note:: + + This property only has effect when policy :policy:`CMP0157` is set to ``NEW`` + prior to the first :command:`project` or :command:`enable_language` command + that enables the Swift language. |