Files
CMake/Help/policy/CMP0195.rst
Evan Wilde 1711e86d6c Swift: Generate nested swift modules in build dir
The nested Swift module structure is recommended for Swift projects.
This structure has an outer directory called
`<Swift_MODULE_NAME>.swiftmodule` that contains generated files for the
interface. The binary swift modules, textual swift interface, and other
supplemental outputs that make up the interface to a Swift library all
go in this outer directory with the Swift module triple as the filename
followed by the appropriate file extension based on what that file
contains.

Issue: #19284
2025-05-21 10:19:58 -07:00

28 lines
1.0 KiB
ReStructuredText

CMP0195
-------
.. versionadded:: 4.1
Swift modules in build trees use the Swift module directory structure.
The Swift compiler emits several supplementary files that make up the
interface to a Swift library. It accepts finding these files separately
or in a single swiftmodule directory. The single file keeps things better
organized and makes it easier to install the resulting products.
CMake versions 4.1 and above prefer to generate the modules in the
directory structure when working with a new enough Swift compiler.
This policy provides compatibility for projects that have not been
updated to expect the new behavior.
The ``OLD`` behavior for this policy is to emit the interface files directly
into the current binary directory.
The ``NEW`` behavior for this policy is to gather the binary swiftmodule and
other supplemental compiler outputs in a single Swift module directory.
.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 4.1
.. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
.. include:: include/STANDARD_ADVICE.rst
.. include:: include/DEPRECATED.rst