gpt4 book ai didi

xcconfig 中的 iOS 链接库

转载 作者:行者123 更新时间:2023-11-29 10:26:02 26 4
gpt4 key购买 nike

我正在 build 一个图书馆。我希望它编译并包含另一个(即 googleConversion),但我需要使用 xcconfig 文件来完成(因为对于某些构建,我不想包含库)

以下:Link binary with static library in xcconfig

所以我所做的就是在我的 xcconfig 文件中添加:

LIBRARY_SEARCH_PATHS = $(inherited) $(PROJECT_DIR)/../Vendors/Analytics/GoogleConversion/GoogleConversionTrackingSDK-iOS-3.2.0 
OTHER_LDFLAGS =$(inherited) -ObjC -L$(PROJECT_DIR)/../Vendors/Analytics/GoogleConversion/GoogleConversionTrackingSDK-iOS-3.2.0 -lGoogleConversionTracking

这让我可以在没有警告的情况下进行编译,但不要在我的 .a 中包含该库

我设法做到这一点的唯一方法是在 Link Binary With Library 的构建阶段添加库。

但如果我希望能够自动化我的不同类型的构建,这不是我能做的事

听起来应该很简单;(

也许其他一些配置阻止了这些线路的工作?

我尝试检查我的日志,我可以在 Libtool 导出路径的“检查依赖项”中看到我可以看到我的 OTHER_LDFLAGS 的解析路径(当我从我的 xcconfig 中删除它时消失)但不是 -lGoogleConversionTracking 存在时我将我的库放在构建阶段。

(我发生了更多事情,如果我从构建阶段完全删除面板,那么 libtool 中什么都没有,但这在某种程度上是有意义的,而且没什么大不了的)

提前致谢!

最佳答案

终于明白了!!!!

这是因为在 xcode 6 中解决了一个旧的 xcode 错误。

https://tarunsharmaios.wordpress.com/2014/09/12/xcode6-static-library-linking-broken/

BlockquoteXcode will no longer pass options in the build setting OTHER_LDFLAGS to libtool when building static libraries, nor will it pass options in OTHER_LIBTOOLFLAGS to the Mach-O linker when building any other kind of product. Previously all options in both settings would be passed to both tools. Make sure that options are in the correct build setting for the product type, static library, or other component being built. (4285249)

关于xcconfig 中的 iOS 链接库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32268834/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com