File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
Sources/Commands/Utilities Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ import PackageGraph
16
16
import PackageModel
17
17
import SPMBuildCore
18
18
import TSCBasic
19
+ import DriverSupport
19
20
20
21
/// A wrapper for swift-symbolgraph-extract tool.
21
22
public struct SymbolGraphExtract {
@@ -71,11 +72,14 @@ public struct SymbolGraphExtract {
71
72
if includeSPISymbols {
72
73
commandLine += [ " -include-spi-symbols " ]
73
74
}
74
- if emitExtensionBlockSymbols {
75
- commandLine += [ " -emit-extension-block-symbols " ]
75
+
76
+ let extensionBlockSymbolsFlag = emitExtensionBlockSymbols ? " -emit-extension-block-symbols " : " -omit-extension-block-symbols "
77
+ if DriverSupport . checkSupportedFrontendFlags ( flags: [ extensionBlockSymbolsFlag. trimmingCharacters ( in: [ " - " ] ) ] , fileSystem: fileSystem) {
78
+ commandLine += [ extensionBlockSymbolsFlag]
76
79
} else {
77
- commandLine += [ " -omit-extension-block-symbols " ]
80
+ print ( " warning: dropped \( extensionBlockSymbolsFlag ) flag because it is not supported by this compiler version " )
78
81
}
82
+
79
83
switch outputFormat {
80
84
case . json( let pretty) :
81
85
if pretty {
You can’t perform that action at this time.
0 commit comments