Xcode 4 build Static Library dependency with diffe

2019-03-19 03:26发布

I was wondering whether it is possible to have dependant static library compiled with different configuration settings.

My case was I have a project (project.pbxproj) which is dependant on a static library (cocoa touch) project (libStatic.pbxproj). My project has let say 3 configuration settings, like debug, release and ad-hoc, while my libStatic will only have 2 which is debug and release. So my question is, it is possible to have the ad-hoc configuration settings on the main project to cause the static library compiled under the release settings?

Currently I have errors on building(compiling) the project only for the ad-hoc settings, while everything runs perfectly with both the release and debug settings.

My reference on building the static library was http://blog.carbonfive.com/2011/04/04/using-open-source-static-libraries-in-xcode-4/

Thanks before

Cheers,

2条回答
淡お忘
2楼-- · 2019-03-19 03:53

I do not know of a way to trigger different configuration builds, but what you are trying to achieve can be done with different targets. A target of the dependent project can trigger a specific target of the dependency project. You can set this in the Target Dependencies build phase.

查看更多
我想做一个坏孩纸
3楼-- · 2019-03-19 04:07

To extend what rage said, you'll want to use targets instead of configurations. Targets are all about what is built where as configurations is how to build.

You may also want to look at lipo. Its useful for combining static libs such as simulator and device into 1 static lib resource. I haven't played with it extensively but maybe there is a way to have different configs as well and somehow use the right config when the parent project is built.

查看更多
登录 后发表回答