Imagine I mark the following method deprecated in Swift:
@available(*, deprecated=1.0)
func myFunc() {
// ...
}
And I treat warnings as errors in Swift by setting OTHER_SWIFT_FLAGS="-warnings-as-errors"
.
How do I make it show these deprecation notices as warnings, while still treating the rest of the warnings as errors?
It seems like GCC had a pretty good solution to this problem:
-Werror // treat all warnings as errors
-Wno-error=<warning> // don't treat <warning> as error (e.g. -Wno-error=switch)
-Werror=<warning> // treat <warning> as error
So if this was Objective-C, I could simply use -Werror -Wno-error=deprecated-declarations
and get exactly what I want.
What is the equivalent for Swift?
I tried adding -Wno-error=deprecated-declarations
to the OTHER_SWIFT_FLAGS
, but it seems like it's not meant for Swift, so it doesn't work.