如何在XCode 4(iOS)中使用EXCLUDED_SOURCE_FILE_NAMES [英] How do I use EXCLUDED_SOURCE_FILE_NAMES in XCode 4 (iOS)

查看:167
本文介绍了如何在XCode 4(iOS)中使用EXCLUDED_SOURCE_FILE_NAMES的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在XCode中找到了一些对构建设置的引用,称为EXCLUDED_SOURCE_FILE_NAMES-下面的模式提示了它的工作方式.但是我不知道如何在XCode(4.02)中使用此选项.

I've found several references to a build setting in XCode called EXCLUDED_SOURCE_FILE_NAMES - the pattern below hints at how it works. But I can't figure out how to use this option in XCode (4.02).

"EXCLUDED_SOURCE_FILE_NAMES [sdk = iphoneos *] [arch = *]" = ...

"EXCLUDED_SOURCE_FILE_NAMES[sdk=iphoneos*][arch=*]" = ...

目标是在目标是Simulator时编译一个或多个源文件,在目标是iOS设备时编译另一组源文件.

The goal is to have one or more source files compile when the target is the Simulator, and a different set of source files compile when the target is an iOS device.

我认为我需要告诉xcode每个目标的文件列表.那么,如何使用此设置来实现呢?它在XCode哪里去了?是否有任何有关此操作的文档?

I figure I need to tell xcode the list of files for each target. So, how do I implement that using this setting? Where in XCode does it go? Is there any documentation for how to do this?

我还需要对静态库执行相同的操作.具体来说-我有一个要包含在我的项目中的静态库,但该库仅支持arm不支持​​i386,因此,在构建模拟器时,需要从链接中排除该文件!

I also need to do the same thing with a static lib. Specifically - I have a static lib I want to include in my project, but the lib only supports arm not i386, so, when building for the simulator, I need to exclude this file from being linked!

可以做到吗?

推荐答案

基本上EXCLUDED_SOURCE_FILE_NAMES只会从该构建配置中删除这些文件

Basically EXCLUDED_SOURCE_FILE_NAMES will just remove those files from that build configuration

如果您要从构建配置中删除静态库,那么这就是方法.

If you want to remove a static library from a build configuration, then this is the way to go.

要实现此目的,只需转到目标的构建设置",然后单击添加构建设置"按钮,然后为目标添加EXCLUDED_SOURCE_FILE_NAMES配置.

To implement this, just go to the "Build Settings" of your Target, then click on the "Add Build Setting" button and add the EXCLUDED_SOURCE_FILE_NAMES configuration for your target.

然后,您可以为每个构建配置指定要排除的文件名...

Then you can specify which file names to exclude for each build configuration...

以您为例,由于您提到了不同文件的列表,因此您可能应该创建2套应用程序捆绑包,然后在EXCLUDED_SOURCE_FILE_NAMES中排除捆绑包

In your case and since you mentioning a list of different files, then you should probably create 2 set of app bundles, then exclude the bundles in the EXCLUDED_SOURCE_FILE_NAMES

因此,如果您创建一个名为Simulator.bundle的捆绑软件和一个名为release.bundle的捆绑软件,则您将在Release Configuration中将模拟器.bundle文件排除在模拟器配置之外,而在模拟器配置中将release.bundle排除在外...

So if you create a bundle named simulator.bundle and a bundle named release.bundle you would exclude the simulator.bundle file in the Release Configuration and the release.bundle in the simulator configuration...

这篇关于如何在XCode 4(iOS)中使用EXCLUDED_SOURCE_FILE_NAMES的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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