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 @@ -322,6 +322,16 @@ public final class ProductBuildDescription: SPMBuildCore.ProductBuildDescription
322
322
// User arguments (from -Xlinker) should follow generated arguments to allow user overrides
323
323
args += self . buildParameters. flags. linkerFlags. asSwiftcLinkerFlags ( )
324
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
+
325
335
// Pass default library paths from the toolchain.
326
336
for librarySearchPath in self . buildParameters. toolchain. librarySearchPaths {
327
337
args += [ " -L " , librarySearchPath. pathString]
You can’t perform that action at this time.
0 commit comments