New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PCH and Xcode 6 #11
Comments
A nice introduction about modules : http://stackoverflow.com/questions/18947516/import-vs-import-ios-7 |
My availability macros don't work since modules. You can turn off modules, but that's not really a very good idea. We'll just need to petition Apple for a feature that allows us to catch the use of unavailable code! |
@mattjgalloway the clang option exists : -Wpartial-availability. But is not available in "apple clang". It has been added a while : http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20150316/125999.html Created bugreport 23066340 |
Ok, the only thing to do is to replace CFAvailability.h within xcode SDKs and put your macros inside. Just tested and it works with modules (changing deployment target make error appearing/disappearing correctly). Not fan of "patching" Xcode internals... but it is too important : I don't want to push an App on the Store with a newer API call unchecked. Simply pasted your code in /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h after these lines :
|
Moved the define back to MJGAvailability.h (because other devs would not have patched their xcode, and this macro have to be known) and using -imacro compile flag to inject them. |
@mattjgalloway -Wpartial-availability is available in Xcode 7.3 beta 2 :-) |
Just created a new project with Xcode 6, and there are no more a pch include (manually added, http://stackoverflow.com/questions/24158648/why-isnt-projectname-prefix-pch-created-automatically-in-xcode-6)
To include Source/Utilities/MJGAvailability.h and see if I use newer call than supported OS on top of all header files (which is a nice tool to not miss such a bug).
This issue is not really one but more a question about this "missing feature" from Xcode, as I don't know much about objc modules (which tend to suppress pch utility) : do the manual add of a pch is still valuable ?
The text was updated successfully, but these errors were encountered: