jeffwong
jeffwong

Reputation: 335

How can I tell Cocoapods to inherit LIBRARY_SEARCH_PATHS from the current target?

In my project, we link against a few binary libraries that we keep under source control. We also use a Cocoapod which provides a library in binary form.

At the project level, we specify library search paths to our local libraries. When we add the binary Cocoapod to this target, resulting xcconfig file sets the LIBRARY_SEARCH_PATHS config variable and conflicts with our project setting for this. We see this warning:

[!] 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.

Our workaround is to put the path to the Cocoapods library in our target search path and let it override the one from xcconfig.

To avoid overriding, we could put the $(inherited) flag in the xcconfig file, but then that means that we need to put the xcconfig into source control and reset it after running pod install.

Is there a correct way to do this?

Is there something we can set in the Podfile to add paths or the $(inherited) flag?

Thanks for reading!

Upvotes: 4

Views: 2430

Answers (1)

nprd
nprd

Reputation: 1942

You can use post install hook to insert your own static library or framework which you don't install through pods. https://guides.cocoapods.org/syntax/podfile.html#post_install

Upvotes: 1

Related Questions