Skip to content

Commit af42b87

Browse files
authored
Merge pull request #730 from xymus/emit-module-default
Make emit-module-separately the default incremental build mode
2 parents 1365c86 + 582e81a commit af42b87

File tree

2 files changed

+107
-93
lines changed

2 files changed

+107
-93
lines changed

Sources/SwiftDriver/Jobs/EmitModuleJob.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ extension Driver {
8080

8181
addCommonModuleOptions(commandLine: &commandLine, outputs: &outputs, isMergeModule: false)
8282

83+
try commandLine.appendLast(.emitSymbolGraph, from: &parsedOptions)
84+
try commandLine.appendLast(.emitSymbolGraphDir, from: &parsedOptions)
85+
8386
if parsedOptions.hasArgument(.parseAsLibrary, .emitLibrary) {
8487
commandLine.appendFlag(.parseAsLibrary)
8588
}
@@ -102,6 +105,7 @@ extension Driver {
102105
var shouldCreateEmitModuleJob: Bool {
103106
mutating get {
104107
return moduleOutputInfo.output != nil
108+
&& inputFiles.allSatisfy() { $0.type.isPartOfSwiftCompilation } // Ignore calls for linking.
105109
&& (forceEmitModuleBeforeCompile
106110
|| shouldEmitModuleSeparately())
107111
}
@@ -111,7 +115,7 @@ extension Driver {
111115
mutating func shouldEmitModuleSeparately() -> Bool {
112116
return parsedOptions.hasFlag(positive: .emitModuleSeparately,
113117
negative: .noEmitModuleSeparately,
114-
default: false)
118+
default: true)
115119
&& !parsedOptions.hasFlag(positive: .wholeModuleOptimization,
116120
negative: .noWholeModuleOptimization,
117121
default: false)

0 commit comments

Comments
 (0)