@@ -1407,25 +1407,21 @@ public final class SwiftCompilerSpec : CompilerSpec, SpecIdentifierType, SwiftDi
1407
1407
let buildSettingEnabled = scope. evaluate ( BuiltinMacros . SWIFT_ENABLE_EXPLICIT_MODULES) == . enabled ||
1408
1408
scope. evaluate ( BuiltinMacros . _EXPERIMENTAL_SWIFT_EXPLICIT_MODULES) == . enabled
1409
1409
1410
+ // If this project is on the blocklist, override the blocklist default enable for it
1411
+ if let explicitModuleBlocklist = await getExplicitModuleBlocklist ( producer, scope, delegate) , explicitModuleBlocklist. isProjectListed ( scope) {
1412
+ return false
1413
+ }
1414
+
1410
1415
// rdar://122829880 (Turn off Swift explicit modules when c++ interop is enabled)
1411
1416
guard scope. evaluate ( BuiltinMacros . SWIFT_OBJC_INTEROP_MODE) != " objcxx " && !scope. evaluate ( BuiltinMacros . OTHER_SWIFT_FLAGS) . contains ( " -cxx-interoperability-mode=default " ) else {
1412
- return scope. evaluate ( BuiltinMacros . _SWIFT_EXPLICIT_MODULES_ALLOW_CXX_INTEROP)
1417
+ return scope. evaluate ( BuiltinMacros . _SWIFT_EXPLICIT_MODULES_ALLOW_CXX_INTEROP) && buildSettingEnabled
1413
1418
}
1414
1419
1415
1420
// Disable explicit modules in the pre-Swift-5 language modes to avoid versioned API notes confusion.
1416
1421
guard let swiftVersion = try ? Version ( scope. evaluate ( BuiltinMacros . SWIFT_VERSION) ) , swiftVersion >= Version ( 5 ) else {
1417
- return scope. evaluate ( BuiltinMacros . _SWIFT_EXPLICIT_MODULES_ALLOW_BEFORE_SWIFT_5)
1422
+ return scope. evaluate ( BuiltinMacros . _SWIFT_EXPLICIT_MODULES_ALLOW_BEFORE_SWIFT_5) && buildSettingEnabled
1418
1423
}
1419
1424
1420
- // If a blocklist is provided in the toolchain, use it to determine the default for the current project
1421
- guard let explicitModuleBlocklist = await getExplicitModuleBlocklist ( producer, scope, delegate) else {
1422
- return buildSettingEnabled
1423
- }
1424
-
1425
- // If this project is on the blocklist, override the blocklist default enable for it
1426
- if explicitModuleBlocklist. isProjectListed ( scope) {
1427
- return false
1428
- }
1429
1425
return buildSettingEnabled
1430
1426
}
1431
1427
0 commit comments