在为iOS模拟器构建时,使Xcode忽略静态库 [英] Making Xcode ignore static library when building for iOS Simulator
问题描述
我有一个Xcode项目,其中包含一个静态库项目,它使用另一个不支持iOS模拟器架构的静态库(Vuforia SDK:libQCAR.a)。
I have a Xcode project, that includes a Static Library project, that uses another static library that does not support the iOS simulator architecture (Vuforia SDK: libQCAR.a).
必须将Vuforia应用程序部署到要运行的设备上;它们无法在iOS模拟器中运行。
Vuforia applications must be deployed to a device to run; they cannot be run in the iOS simulator.
这是我的项目结构:
- MyApp.xcodeproj
- 课程
- MyStaticLibrary.xcodeproj
- 依赖于libQCAR.a的类
- libMyStaticLibrary.a
- libQCAR.a
我的问题是
MyApp.xcodeproj
不是为iOS模拟器构建的,因为libQCAR .a
不是为i386架构而构建的。My problem is that
MyApp.xcodeproj
does not build for the iOS Simulator becauselibQCAR.a
is not built for the i386 architecture.无论如何要使
MyApp.xcodeproj
在构建i386时忽略libQCAR.a
库?我可以使用#if禁用所有依赖于库的代码!(TARGET_IPHONE_SIMULATOR)
Is there anyway to make
MyApp.xcodeproj
ignore thelibQCAR.a
library when building for i386? I would be able to disable all the code that depends on the library with#if !(TARGET_IPHONE_SIMULATOR)
推荐答案
这个问题看起来非常类似于: Xcode:基于架构的条件构建设置(设备(ARM)与模拟器(i386))
This issue seems very similar to: Xcode: Conditional Build Settings based on architecture (Device (ARM) vs Simulator (i386))
我相信sergio的解决方案非常关闭,但您是否尝试在其他链接器标志下指定库的完整路径(可能没有-l - 只是路径)?
I believe sergio's solution is very close, but have you tried specifying the full path to the library under Other Linker Flags (potentially without "-l" - just the path)?
这篇关于在为iOS模拟器构建时,使Xcode忽略静态库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!