I'm writing a library of reusable code intended for both OS X and iOS. I created an Xcode project with 2 targets. One target is a framework for OS X. The other is a static library for iOS.
I discovered that builds of the OS X framework target are trying to use the iOS headers. I know this because TARGET_OS_IPHONE is defined causing the build to attempt to find UIKit.h, etc. This of course causes builds for the framework target to fail since the OS X framework target does not link to iOS frameworks.
I checked the build settings for the OS X framework target for goofiness but found nothing. The base SDK is set as "Mac OS X 10.6". Note when I created the Xcode project, I used the Cocoa Framework template then later added the iOS static library target.
What else could cause the OS X framework target to use the wrong SDK?
Thanks, -KIRBY
An XCFramework can be either static or dynamic and can include headers.
An project is a repository for all the files, resources, and information required to build one or more software products. A target specifies a product to build and contains the instructions for building the product from a set of files in a project or workspace.
Choose the project in the Project Navigator on the left. Select the Configurations target from the Targets section and click the Build Settings tab at the top. The Build Settings tab shows the build settings for the Configurations target. It's possible to expand this list with build settings that you define.
Your issue is that Xcode's gotten confused. Option click on the Overview popup and reset your Active SDK to Base SDK. You'll probably find that the Mac target is set to one of the iOS targets, which ends up causing all sorts of hilarity as you've seen
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With