File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
Sources/Build/BuildDescription Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -331,6 +331,16 @@ public final class ProductBuildDescription: SPMBuildCore.ProductBuildDescription
331
331
// User arguments (from -Xlinker) should follow generated arguments to allow user overrides
332
332
args += self . buildParameters. flags. linkerFlags. asSwiftcLinkerFlags ( )
333
333
334
+ // Enable the correct lto mode if requested.
335
+ switch self . buildParameters. linkingParameters. linkTimeOptimizationMode {
336
+ case nil :
337
+ break
338
+ case . full:
339
+ args += [ " -lto=llvm-full " ]
340
+ case . thin:
341
+ args += [ " -lto=llvm-thin " ]
342
+ }
343
+
334
344
// Pass default library paths from the toolchain.
335
345
for librarySearchPath in self . buildParameters. toolchain. librarySearchPaths {
336
346
args += [ " -L " , librarySearchPath. pathString]
You can’t perform that action at this time.
0 commit comments