英文:
How to single-object prelink a framework?
问题
My situation:
- 我正在开发一个名为
A的动态链接框架,打包成.xcframework - 我依赖于其他静态链接的框架
B和C - 但是,我不希望
A的消费者了解B和C的存在 - 因此,我想在链接
A时执行单个对象预链接,以便A完全消耗B和C,并且再也不会看到它们。
如果不是静态框架(.framework)而是静态库(.a),这个任务会相对容易。在这种情况下,我可以将.a的路径轻松放入“Prelink Libraries”设置中,将“Perform Single-Object Prelink”设置为“YES”,禁用嵌入 - 这样就可以实现目标。
然而,我面临的是与框架的链接,而不是库。问题在于它内部有资源和捆绑包。
- 如果将
.xcframework或.framework的路径放入“Prelink Libraries”构建设置中,构建会失败:
Command MasterObjectLink failed with a nonzero exit code
can't map file, errno=22 file '/Users/*****/B/B.xcframework/ios-arm64/B.framework'
- 如果将框架内部实际可执行文件的路径(
B.xcframework/ios-arm64/B.framework/B)放入其中,构建会成功。但是,B.framework的任何资源都不会出现在生成的输出中。
有办法在“Single-Object Prelink”期间自动复制资源吗?
英文:
My situation:
- I am developing a dynamically linked framework called
A, wrapped into.xcframework - I depend upon other frameworks
BandCthat are linked statically - However, I don't want the consumers of
Ato learn about the existence ofBandC - And because of this, I would like to perform single object pre-link during the linkage of
Aso thatBandCare totally consumed byAand 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
.xcframeworkor.frameworkinto thePrelink LibrariesBuild 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 ofB.frameworkare present in the resulting output.
Is there a way to automatically copy resources during Single-Object Prelink?
答案1
得分: 0
没有,如果不使用常规的“嵌入框架”(Embed Frameworks)方法,就没有自动复制资源的方式。
英文:
No, there is no way to automatically copy the resources if the regular Embed Frameworks isn't used.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。


评论