@@ -14,9 +14,10 @@ The target audience for this document is people who want to integrate the Swift
14
14
compiler into their build system, rather than using Xcode or the package
15
15
manager (` swift build ` ). If you're looking to work on the driver itself...well,
16
16
this is probably still useful to you, but you should also check out
17
- DriverInternals.rst and maybe DependencyAnalysis.rst as well. If you're just
18
- using Xcode or SwiftPM and want to find out what mysterious command-line
19
- options you could be passing, ` swiftc --help ` is a better choice.
17
+ [ DriverInternals.rst] ( DriverInternals.rst ) and maybe
18
+ [ DependencyAnalysis.rst] ( DependencyAnalysis.rst ) as well. If you're just using
19
+ Xcode or SwiftPM and want to find out what mysterious command-line options you
20
+ could be passing, ` swiftc --help ` is a better choice.
20
21
21
22
If you're invoking ` swift -frontend ` directly, and you aren't working on the
22
23
compiler itself...well, this document should convince you to not do that.
@@ -25,8 +26,8 @@ Some terms:
25
26
26
27
- For the purposes of this document, a _ module_ is a single distributable unit
27
28
of API. (We use this term for a lot of other things too, though; check out
28
- Lexicon.rst for the full list.) "Foundation" is a single module, as is the
29
- Swift standard library ("Swift"). An app is a module too.
29
+ [ Lexicon.rst] ( Lexicon.rst ) for the full list.) "Foundation" is a single
30
+ module, as is the Swift standard library ("Swift"). An app is a module too.
30
31
31
32
- A _ compilation unit_ is a set of source files that are compiled together. In
32
33
Swift, everything intended to be in the same module must be part of the same
@@ -205,13 +206,13 @@ in becoming more like non-whole-module builds.
205
206
## Incremental Builds ##
206
207
207
208
Incremental builds in Swift work by primarily by cross-file dependency
208
- analysis, described in DependencyAnalysis.rst. Compiling a single file might be
209
- necessary because that file has changed, but it could also be because that file
210
- depends on something else that might have changed. From a build system
211
- perspective, the files in a particular module can't be extracted from each
212
- other; a top-level invocation of the compiler will result in a valid
213
- compilation of the entire module, but manually recompiling certain files is not
214
- guaranteed to do anything sensible.
209
+ analysis, described in [ DependencyAnalysis.rst] ( DependencyAnalysis.rst ) .
210
+ Compiling a single file might be necessary because that file has changed, but
211
+ it could also be because that file depends on something else that might have
212
+ changed. From a build system perspective, the files in a particular module
213
+ can't be extracted from each other; a top-level invocation of the compiler will
214
+ result in a valid compilation of the entire module, but manually recompiling
215
+ certain files is not guaranteed to do anything sensible.
215
216
216
217
Performing an incremental build is easy; just pass ` -incremental ` and be sure to
217
218
put "swift-dependencies" entries in your output file map.
0 commit comments