@@ -28,10 +28,8 @@ public struct Driver {
2828 case unableToDecodeFrontendTargetInfo
2929 case failedToRetrieveFrontendTargetInfo
3030 case missingProfilingData( String )
31- case cannotAssignToConditionalCompilationFlag( String )
3231 case conditionalCompilationFlagHasRedundantPrefix( String )
3332 case conditionalCompilationFlagIsNotValidIdentifier( String )
34- case frameworkSearchPathIncludesExtension( String )
3533 // Explicit Module Build Failures
3634 case malformedModuleDependency( String , String )
3735 case missingPCMArguments( String )
@@ -62,14 +60,10 @@ public struct Driver {
6260 return " failed to retrieve frontend target info "
6361 case . missingProfilingData( let arg) :
6462 return " no profdata file exists at ' \( arg) ' "
65- case . cannotAssignToConditionalCompilationFlag( let name) :
66- return " conditional compilation flags do not have values in Swift; they are either present or absent (rather than ' \( name) ') "
6763 case . conditionalCompilationFlagHasRedundantPrefix( let name) :
6864 return " invalid argument '-D \( name) '; did you provide a redundant '-D' in your build settings? "
6965 case . conditionalCompilationFlagIsNotValidIdentifier( let name) :
7066 return " conditional compilation flags must be valid Swift identifiers (rather than ' \( name) ') "
71- case . frameworkSearchPathIncludesExtension( let arg) :
72- return " framework search path ends in \" .framework \" ; add directory containing framework instead: \( arg) "
7367 // Explicit Module Build Failures
7468 case . malformedModuleDependency( let moduleName, let errorDescription) :
7569 return " Malformed Module Dependency: \( moduleName) , \( errorDescription) "
@@ -1575,6 +1569,12 @@ extension Diagnostic.Message {
15751569 static var error_bridging_header_module_interface : Diagnostic . Message {
15761570 . error( " using bridging headers with module interfaces is unsupported " )
15771571 }
1572+ static func warning_cannot_assign_to_compilation_condition( name: String ) -> Diagnostic . Message {
1573+ . warning( " conditional compilation flags do not have values in Swift; they are either present or absent (rather than ' \( name) ') " )
1574+ }
1575+ static func warning_framework_search_path_includes_extension( path: String ) -> Diagnostic . Message {
1576+ . warning( " framework search path ends in \" .framework \" ; add directory containing framework instead: \( path) " )
1577+ }
15781578}
15791579
15801580// MARK: Miscellaneous Argument Validation
@@ -1611,7 +1611,7 @@ extension Driver {
16111611 diagnosticEngine: DiagnosticsEngine ) {
16121612 for arg in parsedOptions. arguments ( for: . D) . map ( \. argument. asSingle) {
16131613 if arg. contains ( " = " ) {
1614- diagnosticEngine. emit ( Error . cannotAssignToConditionalCompilationFlag ( arg) )
1614+ diagnosticEngine. emit ( . warning_cannot_assign_to_compilation_condition ( name : arg) )
16151615 } else if arg. hasPrefix ( " -D " ) {
16161616 diagnosticEngine. emit ( Error . conditionalCompilationFlagHasRedundantPrefix ( arg) )
16171617 } else if !arg. sd_isSwiftIdentifier {
@@ -1624,7 +1624,7 @@ extension Driver {
16241624 diagnosticEngine: DiagnosticsEngine ) {
16251625 for arg in parsedOptions. arguments ( for: . F, . Fsystem) . map ( \. argument. asSingle) {
16261626 if arg. hasSuffix ( " .framework " ) || arg. hasSuffix ( " .framework/ " ) {
1627- diagnosticEngine. emit ( Error . frameworkSearchPathIncludesExtension ( arg) )
1627+ diagnosticEngine. emit ( . warning_framework_search_path_includes_extension ( path : arg) )
16281628 }
16291629 }
16301630 }
0 commit comments