We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6db2c7d commit 8c513a1Copy full SHA for 8c513a1
Sources/Build/BuildDescription/ProductBuildDescription.swift
@@ -322,6 +322,16 @@ public final class ProductBuildDescription: SPMBuildCore.ProductBuildDescription
322
// User arguments (from -Xlinker) should follow generated arguments to allow user overrides
323
args += self.buildParameters.flags.linkerFlags.asSwiftcLinkerFlags()
324
325
+ // Enable the correct lto mode if requested.
326
+ switch self.buildParameters.linkTimeOptimizationMode {
327
+ case nil:
328
+ break
329
+ case .full:
330
+ args += ["-lto=llvm-full"]
331
+ case .thin:
332
+ args += ["-lto=llvm-thin"]
333
+ }
334
+
335
// Pass default library paths from the toolchain.
336
for librarySearchPath in self.buildParameters.toolchain.librarySearchPaths {
337
args += ["-L", librarySearchPath.pathString]
0 commit comments