依赖库指向设备构建
我有一个 XCode 4 项目,其中有一个附加的依赖项项目。依赖项目创建了主要项目所需的静态库。
我正在尝试从“目标”->“构建阶段”->“将二进制与库链接”添加库,并在工作区中选择静态库。
问题是每次我这样做时,构建设置“库搜索路径”都会附加到 iphoneos 构建的构建路径。当我尝试为模拟器进行编译时,该文件被忽略,因为它不适用于 i386 架构,并且构建失败。
我一直在疯狂地寻找,不明白我在做什么不同的事情。在我看来,XCode 似乎应该发挥一些作用,将模拟器与模拟器、设备与设备链接起来——但对我来说,它总是添加设备或模拟器的特定路径。
(我尝试过使用两个目标来区分它们,这很有效,但这根本不是一个理想的解决方案。我每次都必须更改 2 个目标而不是 1 个。)
希望我能被理解,
pleeeaaaaase 帮助:)
Oded。
I've got an XCode 4 project that has an additional dependency project in it. The dependency project creates a static library I need for the major project.
I'm trying to add the library from the Target->Build Phases->Link Binary With Libraries, choosing the static library in my workspace.
Problem is every time I do that, the build settings "Library Search Paths" is appended a path to the build of the iphoneos build. When I try to compile for simulator, that file is ignored as it not meant for i386 architecture and the build fails.
I've been searching like mad, not understanding what I'm doing differently. Everywhere I look, it seems like XCode should be doing some magic to link simulator with simulator and device with device - But for me it always adds the specific path to either the device or simulator.
(I've tried using two targets to differ them, and that worked, but it's not an ideal solution at all. I have to change 2 targets everytime instead of 1.)
Hope I was understood,
pleeeaaaaase help :)
Oded.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我的同事最终找到了答案 -
在 XCode 4 中,默认情况是将所有项目构建到共享构建文件夹中。我着迷于 XCode 3,将其切换到旧方法,其中构建文件夹位于项目文件夹中。
事实证明,将 XCode 切换到在一个唯一的位置进行构建,可以让奇迹发生,并且可以将相应的构建一起构建。有人告诉我这正是它的用途,但没有参考链接。
Xcode 菜单 ->首选项->地点 ->构建位置:
- 将构建放置在派生数据位置(推荐)
- 独特的子文件夹
干杯,
奥德.
My colleague found the answer eventually -
In XCode 4 the default is to build all projects to a shared building folder. Me being fixated with XCode 3, switched it to the old method in which the build folder is in your project folder.
Turns out switching XCode to build in a single unique place, allowed the magic to happen to and to the corresponding builds be built together. I've been told it's exactly what it's meant for, but have no link to the reference.
XCode Menu -> Preferences -> Locations -> Build Location:
- Place build in derived data location (recommended)
- Unique subfolder
Cheers,
Oded.