Help: add some initial documentation for Swift support

This commit is contained in:
Saleem Abdulrasool
2019-05-08 22:49:33 -07:00
committed by Brad King
parent 9a182c9e5b
commit d745551fb6
11 changed files with 78 additions and 0 deletions

11
Help/envvar/SWIFTC.rst Normal file
View File

@@ -0,0 +1,11 @@
SWIFTC
------
.. include:: ENV_VAR.txt
Preferred executable for compiling ``Swift`` language files. Will only be used by
CMake on the first configuration to determine ``Swift`` compiler, after which the
value for ``SWIFTC`` is stored in the cache as
:variable:`CMAKE_Swift_COMPILER <CMAKE_<LANG>_COMPILER>`. For any configuration run
(including the first), the environment variable will be ignored if the
:variable:`CMAKE_Swift_COMPILER <CMAKE_<LANG>_COMPILER>` variable is defined.

View File

@@ -52,6 +52,7 @@ Environment Variables for Languages
/envvar/FFLAGS
/envvar/RC
/envvar/RCFLAGS
/envvar/SWIFTC
Environment Variables for CTest
===============================

View File

@@ -315,6 +315,9 @@ Properties on Targets
/prop_tgt/STATIC_LIBRARY_FLAGS
/prop_tgt/STATIC_LIBRARY_OPTIONS
/prop_tgt/SUFFIX
/prop_tgt/Swift_DEPENDENCIES_FILE
/prop_tgt/Swift_MODULE_DIRECTORY
/prop_tgt/Swift_MODULE_NAME
/prop_tgt/TYPE
/prop_tgt/VERSION
/prop_tgt/VISIBILITY_INLINES_HIDDEN
@@ -439,6 +442,8 @@ Properties on Source Files
/prop_sf/SKIP_AUTOMOC
/prop_sf/SKIP_AUTORCC
/prop_sf/SKIP_AUTOUIC
/prop_sf/Swift_DEPENDENCIES_FILE
/prop_sf/Swift_DIAGNOSTICS_FILE
/prop_sf/SYMBOLIC
/prop_sf/VS_COPY_TO_OUT_DIR
/prop_sf/VS_CSHARP_tagname

View File

@@ -97,6 +97,7 @@ Variables that Provide Information
/variable/CMAKE_SOURCE_DIR
/variable/CMAKE_STATIC_LIBRARY_PREFIX
/variable/CMAKE_STATIC_LIBRARY_SUFFIX
/variable/CMAKE_Swift_MODULE_DIRECTORY
/variable/CMAKE_TOOLCHAIN_FILE
/variable/CMAKE_TWEAK_VERSION
/variable/CMAKE_VERBOSE_MAKEFILE

View File

@@ -0,0 +1,5 @@
Swift_DEPENDENCIES_FILE
-----------------------
This property sets the path for the Swift dependency file (swiftdeps) for the
source.

View File

@@ -0,0 +1,4 @@
Swift_DIAGNOSTICS_FILE
----------------------
This property controls where the Swift diagnostics are serialized.

View File

@@ -0,0 +1,5 @@
Swift_DEPENDENCIES_FILE
-----------------------
This property sets the path for the Swift dependency file (swiftdep) for the
target.

View File

@@ -0,0 +1,10 @@
Swift_MODULE_DIRECTORY
----------------------
Specify output directory for Swift modules provided by the target.
If the target contains Swift source files, this specifies the directory in which
the modules will be placed. When this property is not set, the modules will be
placed in the build directory corresponding to the target's source directory.
If the variable :variable:`CMAKE_Swift_MODULE_DIRECTORY` is set when a target is
created its value is used to initialise this property.

View File

@@ -0,0 +1,5 @@
Swift_MODULE_NAME
-----------------
This property specifies the name of the Swift module. It is defaulted to the
name of the target.

View File

@@ -0,0 +1,23 @@
Swift Language Support
----------------------
* Preliminary support for the Swift language with the :generator:`Ninja`
generator was added. Use the :envvar:`SWIFTC` environment variable to
specify a compiler.
* Support to emit an output file map was added to enable Swift compilation.
* A target property :prop_tgt:`Swift_DEPENDENCIES_FILE` was added to targets to
indicate where to save the target swift dependencies file. If one is not
specified, it will default to `<TARGET>.swiftdeps`.
* A target property :prop_tgt:`Swift_MODULE_NAME` was added to targets to
indicate the Swift module name. If it is not specified, it will default to
the name of the target.
* A source property :prop_sf:`Swift_DEPENDENCIES_FILE` was added to sources to
indicate where to save the target swift dependencies file. If one is not
specified, it will default to `<OBJECT>.swiftdeps`.
* A source property :prop_sf:`Swift_DIAGNOSTICS_FILE` was added to sources to
indicate where to write the serialised Swift diagnostics.

View File

@@ -0,0 +1,8 @@
CMAKE_Swift_MODULE_DIRECTORY
----------------------------
Swift module output directory.
This variable is used to initialise the :prop_tgt:`Swift_MODULE_DIRECTORY`
property on all the targets. See the target property for additional
information.