Xcode 6:为每个体系结构设置预处理器宏 [英] Xcode 6: Set Preprocessor Macros per architecture
问题描述
我想了解如何正确配置Xcode iOS项目,以便我可以架构指定不同的预处理器宏。我的项目依赖的C ++库需要一个标志设置告诉他们是否在32位或64位平台上运行。
I would like to learn how to properly configure an Xcode iOS project so that I can specify different Preprocessor Macros per architecture. The C++ libraries that my project relies on want a flag set to tell them if they are running on a 32-bit or 64-bit platform.
由于苹果现在要求所有提交为32位和64位,我不能再通过使用ARCHS_STANDARD_32_BIT并只使用一个32位配置。
Since Apple now requires all submissions to be both 32-bit and 64-bit, I can no longer get by using ARCHS_STANDARD_32_BIT and just using a single 32-bit configuration.
似乎Xcode UI只允许我指定每个构建类型的宏(调试/释放)。我在developer.apple.com上没有找到具体的解决方案。
It seems that the Xcode UI will only let me specify macros per build type (Debug/Release). And I haven't found a specific solution on developer.apple.com.
有没有办法在编译器中指定这些定义?
Is there a way that I can specify these definitions in the compiler?
我需要使用前缀头吗?
Do I need to use a prefix header instead? If so, are there any best practices?
有没有人有一个神奇的CMAKE配置,可以解决我所有的问题?
Does anybody out there have a magical CMAKE configuration that will solve all my problems?
我的目标是在模拟器和设备上配置一个干净的配置。
My goal is to have a configuration that works cleanly in both the simulator and on the device.
感谢您的帮助。
推荐答案
当选择预处理器宏时,您可以为发布和调试选择不同的值。当你把光标放在发布或调试,你会注意到+按钮。点击那个+按钮,你将能够选择要为其指定宏的架构。
When you select Preprocessor Macros, you can select different values for Release and Debug. When you put cursor on Release or Debug you will notice + button. Clicking on that + button you will be able to choose architecture for which you want to specify macro.
= ==================================================== ================
===================================================================
这篇关于Xcode 6:为每个体系结构设置预处理器宏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!