Xcode 4构建静态库依赖与不同的配置设置 [英] Xcode 4 build Static Library dependency with different configuration setting

查看:241
本文介绍了Xcode 4构建静态库依赖与不同的配置设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否可以使用不同的配置设置编译依赖的静态库。



我的例子是我有一个项目(project.pbxproj)依赖于静态库(可可触摸)项目(libStatic.pbxproj)。我的项目已经让我说3配置设置,像调试,发布和ad-hoc,而我的libStatic将只有2是调试和发布。所以我的问题是,有可能在主项目上的ad-hoc配置设置导致静态库编译的版本设置?



目前我有错误在构建(编译)项目只为ad-hoc设置,而一切运行完美与发布和调试设置。



我建立静态库的参考是 http://blog.carbonfive.com/2011/04/04/using-open-source-static-libraries-in-xcode-4/

感谢之前



干杯,

解决方案

为了扩展rage的说法,你需要使用目标而不是配置。目标是关于如何构建配置的内容。



您还可以查看lipo。它对于将静态库(如模拟器和设备)组合到1个静态库资源很有用。我没有玩过它广泛,但也许有一种方法有不同的配置,以及在父项目构建时使用正确的配置。


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,

解决方案

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.

这篇关于Xcode 4构建静态库依赖与不同的配置设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆