File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -142,6 +142,7 @@ public final class BuiltinMacros {
142
142
public static let HOST_TARGETED_PLATFORM_NAME = BuiltinMacros . declareStringMacro ( " HOST_TARGETED_PLATFORM_NAME " )
143
143
public static let SUPPORTS_MACCATALYST = BuiltinMacros . declareBooleanMacro ( " SUPPORTS_MACCATALYST " )
144
144
public static let SUPPORTS_ON_DEMAND_RESOURCES = BuiltinMacros . declareBooleanMacro ( " SUPPORTS_ON_DEMAND_RESOURCES " )
145
+ public static let __ORIGINAL_SDK_DEFINED_LLVM_TARGET_TRIPLE_SYS = BuiltinMacros . declareStringMacro ( " __ORIGINAL_SDK_DEFINED_LLVM_TARGET_TRIPLE_SYS " )
145
146
public static let SWIFT_PLATFORM_TARGET_PREFIX = BuiltinMacros . declareStringMacro ( " SWIFT_PLATFORM_TARGET_PREFIX " )
146
147
public static let TVOS_DEPLOYMENT_TARGET = BuiltinMacros . declareStringMacro ( " TVOS_DEPLOYMENT_TARGET " )
147
148
public static let VALID_ARCHS = BuiltinMacros . declareStringListMacro ( " VALID_ARCHS " )
@@ -2281,6 +2282,7 @@ public final class BuiltinMacros {
2281
2282
SWIFT_SYSTEM_INCLUDE_PATHS,
2282
2283
PACKAGE_RESOURCE_BUNDLE_NAME,
2283
2284
PACKAGE_RESOURCE_TARGET_KIND,
2285
+ __ORIGINAL_SDK_DEFINED_LLVM_TARGET_TRIPLE_SYS,
2284
2286
SWIFT_PLATFORM_TARGET_PREFIX,
2285
2287
USE_SWIFT_RESPONSE_FILE, // remove in rdar://53000820
2286
2288
SWIFT_INSTALL_MODULE,
Original file line number Diff line number Diff line change @@ -2524,6 +2524,7 @@ private class SettingsBuilder {
2524
2524
}
2525
2525
2526
2526
if let llvmTargetTripleSys = variant. llvmTargetTripleSys {
2527
+ sdkTable. push ( BuiltinMacros . __ORIGINAL_SDK_DEFINED_LLVM_TARGET_TRIPLE_SYS, literal: llvmTargetTripleSys)
2527
2528
sdkTable. push ( BuiltinMacros . SWIFT_PLATFORM_TARGET_PREFIX, literal: llvmTargetTripleSys)
2528
2529
}
2529
2530
@@ -4101,7 +4102,10 @@ private class SettingsBuilder {
4101
4102
// setting will primarily be used to support building Swift modules for deprecated (or at least unsupported)
4102
4103
// architectures.
4103
4104
let originalModuleOnlyArchs = scope. evaluate ( BuiltinMacros . SWIFT_MODULE_ONLY_ARCHS)
4104
- let moduleOnlyArchs = onlyActiveArchApplied ? [ ] : originalModuleOnlyArchs
4105
+ // Detect discouraged overrides of SWIFT_PLATFORM_TARGET_PREFIX and use this as a signal to suppress
4106
+ // module only architectures
4107
+ let tripleOverridesApplied = scope. evaluate ( BuiltinMacros . SWIFT_PLATFORM_TARGET_PREFIX) != scope. evaluate ( BuiltinMacros . __ORIGINAL_SDK_DEFINED_LLVM_TARGET_TRIPLE_SYS)
4108
+ let moduleOnlyArchs = ( onlyActiveArchApplied || tripleOverridesApplied) ? [ ] : originalModuleOnlyArchs
4105
4109
. filter { validArchs. contains ( $0) }
4106
4110
. filter { !excludedArchs. contains ( $0) }
4107
4111
. filter { !effectiveArchs. contains ( $0) }
You can’t perform that action at this time.
0 commit comments