How to single-object prelink a framework?

My situation:

  • I am developing a dynamically linked framework called A, wrapped into .xcframework
  • I depend upon other frameworks B and C that are linked statically
  • However, I don't want the consumers of A to learn about the existence of B and C
  • And because of this, I would like to perform single object pre-link during the linkage of A so that B and C are totally consumed by A and are to be never seen again.

This task would be relatively easy if instead of static frameworks (.framework), I used static libraries (.a). In this case, I would be able to easily plop the path to the .a into the Prelink Libraries setting, set Perform Single-Object Prelink to YES, disable the embedding - and the goal would be accomplished.

However, I am facing the linkage against frameworks, not libs. The problem is that it has resources and bundles inside of it.

  • If I put a path to the .xcframework or .framework into the Prelink Libraries Build Setting, the build fails:
Command MasterObjectLink failed with a nonzero exit code
can't map file, errno=22 file '/Users/*****/B/B.xcframework/ios-arm64/B.framework'
  • And if I put a path to the actual executable inside the framework (B.xcframework/ios-arm64/B.framework/B), the build succeeds. However, none of the resources of B.framework are present in the resulting output.

Is there a way to automatically copy resources during Single-Object Prelink?

Replies

No, there is no way to automatically copy the resources if the regular Embed Frameworks isn't used.

It has to be done manually.