When building a static library I write with iOS 8 SDK, the resulting library links with the metal framework:
$ otool -arch all -fl <static library>
...
Load command 12
519 cmd LC_LINKER_OPTION
520 cmdsize 32
521 count 2
522 string #1 -framework
523 string #2 Metal
...
I think this is through UIKit; I don't link against it directly and 'Link with standard libraries' is NO. This causes problems on Xcode 5.1.1 with iOS 7 as this framework doesn't exist. Building the static lib with Xcode 5 does not link with metal, but I'd rather build with the latest production release of Xcode, and at some point I'll have to tackle this problem. How can I build with Xcode 6 and work around this issue for Xcode 5 users?
See also another developer with this issue, he simply used the specific frameworks he required which didn't link with Metal, but I can't do that as I need to link with UIKit: https://github.com/card-io/card.io-iOS-SDK/issues/66 https://github.com/CocoaPods/CocoaPods/issues/2457
Dave from card.io here. I.e., the "another developer" referenced above.
Our solution, which should work for you, was to set to NO
two build settings when building our static library: CLANG_ENABLE_MODULES
and CLANG_MODULES_AUTOLINK
(a.k.a Enable Modules (C and Objective-C)
and Link Frameworks Automatically
).
Building your library with these module settings disabled will eliminate the LC_LINKER_OPTION
commands altogether.
The app that uses your library can either enable those modules settings or not. It's the app (and not your library) that must include UIKit.framework
etc., either automatically via modules or manually as a "linked library".
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