Skip to content

Commit f4c9d20

Browse files
committed
Make the use of libSwiftScan opt-in, defaulting to swift-frontend.
This library is unavailable in some contexts and on some architectures. For now, let's have the swift-frontend flow be the default.
1 parent 2aa1edf commit f4c9d20

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

Sources/SwiftDriver/Jobs/EmitSupportedFeaturesJob.swift

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,17 @@ extension Driver {
5757
fileSystem: FileSystem,
5858
executor: DriverExecutor, env: [String: String])
5959
throws -> Set<String> {
60-
// If libSwiftScan library is present, use it to query
61-
let swiftScanLibPath = try Self.getScanLibPath(of: toolchain,
62-
hostTriple: hostTriple,
63-
env: env)
60+
if env["SWIFT_DRIVER_USE_SWIFT_SCAN_FEATURES_QUERY"] != nil {
61+
// If libSwiftScan library is present, use it to query
62+
let swiftScanLibPath = try Self.getScanLibPath(of: toolchain,
63+
hostTriple: hostTriple,
64+
env: env)
6465

65-
if fileSystem.exists(swiftScanLibPath) {
66-
let libSwiftScanInstance = try SwiftScan(dylib: swiftScanLibPath)
67-
if libSwiftScanInstance.canQuerySupportedArguments() {
68-
return try libSwiftScanInstance.querySupportedArguments()
66+
if fileSystem.exists(swiftScanLibPath) {
67+
let libSwiftScanInstance = try SwiftScan(dylib: swiftScanLibPath)
68+
if libSwiftScanInstance.canQuerySupportedArguments() {
69+
return try libSwiftScanInstance.querySupportedArguments()
70+
}
6971
}
7072
}
7173

0 commit comments

Comments
 (0)