Skip to content

Commit bcb4b1a

Browse files
authored
Remove -incremental when using -whole-module-optimization (#6728)
Passing both results in noisy remarks when building from the command line like: ``` remark: Incremental compilation has been disabled: it is not compatible with whole module optimization ``` https://forums.swift.org/t/incremental-compilation-has-been-disabled-it-is-not-compatible-with-whole-module-optimization/66092
1 parent a5703e8 commit bcb4b1a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Sources/LLBuildManifest/Tools.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,6 @@ public struct SwiftCompilerTool: ToolProtocol {
316316
}
317317
}
318318
arguments += [
319-
"-incremental",
320319
"-emit-dependencies",
321320
"-emit-module",
322321
"-emit-module-path", moduleOutputPath.pathString,
@@ -327,6 +326,8 @@ public struct SwiftCompilerTool: ToolProtocol {
327326
}
328327
if wholeModuleOptimization {
329328
arguments += ["-whole-module-optimization", "-num-threads", "\(Self.numThreads)"]
329+
} else {
330+
arguments += ["-incremental"]
330331
}
331332
arguments += ["-c", "@\(self.fileList.pathString)"]
332333
arguments += ["-I", importPath.pathString]

0 commit comments

Comments
 (0)