在我的项目中,我们链接了一些我们保持源代码控制的二进制库.我们还使用
Cocoapod,它提供二进制形式的库.
在项目级别,我们指定本地库的库搜索路径.当我们将二进制Cocoapod添加到此目标时,生成的xcconfig文件会设置LIBRARY_SEARCH_PATHS配置变量并与我们的项目设置冲突.我们看到这个警告:
[!] The `MyProject [Debug]` target overrides the `LIBRARY_SEARCH_PATHS` build setting defined in `Pods/Target Support Files/Pods-MyProject/Pods-MyProject.debug.xcconfig'. This can lead to problems with the CocoaPods installation - Use the `$(inherited)` flag,or - Remove the build settings from the target.
我们的解决方法是将Cocoapods库的路径放在目标搜索路径中,并让它覆盖xcconfig中的路径.
为了避免覆盖,我们可以将$(inherited)标志放在xcconfig文件中,但这意味着我们需要将xcconfig放入源代码控制并在运行pod install后重置它.
有没有正确的方法来做到这一点?
我们可以在Podfile中设置添加路径或$(继承)标志吗?
谢谢阅读!
解决方法
您可以使用post install hook来插入您不通过pod安装的静态库或框架.
https://guides.cocoapods.org/syntax/podfile.html#post_install
https://guides.cocoapods.org/syntax/podfile.html#post_install