ios - Xcode: Universal framework: Conditionally link other .framework dependency for specific platform only -
while working universal framework targets apple platforms wish conditionally link .framework
dependency osx only.
i can add dependency linked framework , libraries , mark optional. don't know custom field should add or modify in build settings
link .framework
specific platform only. (without since dependency optional - build fail ld: framework not found
)
any suggestion guys?
as workaround can split on 2 targets: 1 osx , 1 else, derail concept of universal framework.
this can achieved without resorting linked framework , libraries.
while have universal target full range of supported platforms: macosx iphoneos iphonesimulator appletvos appletvsimulator watchos watchsimulator
, consider case want link framework osx only.
for linking our framework need 2 things:
- add path desired
.framework
framework search path - add
-framework yourframeworkname
other linker flags
and build settings allows specify fields conditional specific platform. when expanding individual field , hovering mouse on debug/release, able see plus sign appearing, pressing on plus sign bring picker able select desired platform.
the hypothetical added build settings linking realm
, realmswift
osx following way:
(both intel 64-bit arch , macos sdk represent building osx)
Comments
Post a Comment