CocoaPods/CocoaPods — Issue #117: What do do about dynamic libraries when linking?
Author: lukeredpath
Created: 2012-02-10 03:10:50+00:00
State: open

I've just written a spec for [SocketRocket](https://github.com/CocoaPods/Specs/blob/master/SocketRocket/0.1/SocketRocket.podspec) which requires libicucore.dylib.

As you can see, I've configured the spec libraries, so "-licucore" get's added to the OTHER_LD_FLAGS. This works fine when you are using SocketRocket as a dependency of an app.

Where it doesn't work, is when SocketRocket is a dependency for a static library target (which is what I'm trying to do). In this case, including -licucore causes the build to fail. Here's the errors from libtool:

```
/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/libtool: can't locate file for: -licucore
/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/libtool: file: -licucore is not an object file (not allowed in a library)
```

Leaving the linker flag out results in a successful build.

This is of course mainly an issue for development; end users of my library (libPusher) would simply add it to their Podfile for their app; libPusher's podspec will contain the dependency on SocketRocket and their app will get the -licucore flag it needs.

So, what can we do about this? Perhaps we don't need to do anything too clever here (again, this is mainly an issue for people developing their own static libraries). Perhaps we could extend the Podfile DSL to provide direct access to the xcconfig API so we can manipulate it to our own ends (in this case, delete the -licucore flag).

Obviously I can edit the xcconfig file directly but it will just get overwritten when I next run `pod install`.