Build Settings Depending on Xcode Version
This weekend I wanted to setup Precompiled Bridging Headers for my project. This setting is available in the new Xcode 8.3 beta. Then building for latest official XCode (8.2.1) the code will not compile because the Swift compiler doesn’t recognize it. How do we use different build settings for different Xcode versions? Only possible with xcconfig files.
There’s an undocumented build setting called XCODE_VERSION_MINOR
that we can use here. And after some variable substitution we’ll make it work. Here’s the gist:
1 2 3 4 5 6 |
|
Full credit to Samantha Marshall’s excellent writeups of xcconfig files. Take a read, very useful to refer to.