Skip to content

Commit fd1590a

Browse files
committed
Pass -warn-on-potentially-unavailable-enum-case frontend flag when building a module
Fixes rdar://problem/78306593.
1 parent 29ee108 commit fd1590a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Sources/SwiftDriver/Jobs/FrontendJobHelpers.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,13 @@ extension Driver {
8585
commandLine.appendFlag("-aarch64-use-tbi")
8686
}
8787

88+
// Potentially unavailable enum cases are downgraded to a warning when building a
89+
// swiftmodule, to allow building a module (or module interface) for an older
90+
// deployment target than the framework itself.
91+
if compilerOutputType == .swiftModule {
92+
commandLine.appendFlag("-warn-on-potentially-unavailable-enum-case")
93+
}
94+
8895
// Enable or disable ObjC interop appropriately for the platform
8996
if targetTriple.isDarwin {
9097
commandLine.appendFlag(.enableObjcInterop)

0 commit comments

Comments
 (0)