如何在 XCode 4 (iOS) 中使用 EXCLUDED_SOURCE_FILE_NAMES
我在 XCode 中发现了几个对名为 EXCLUDED_SOURCE_FILE_NAMES 的构建设置的引用 - 下面的模式暗示了它的工作原理。但我不知道如何在 XCode (4.02) 中使用这个选项。
"EXCLUDED_SOURCE_FILE_NAMES[sdk=iphoneos*][arch=*]" = ...
目标是当目标是模拟器时编译一个或多个源文件,当目标是 iOS 时编译一组不同的源文件设备。
我想我需要告诉 xcode 每个目标的文件列表。那么,我如何使用这个设置来实现呢?它在 XCode 中的哪里?有任何文档说明如何执行此操作吗?
我还需要对静态库做同样的事情。具体来说 - 我想在我的项目中包含一个静态库,但该库仅支持arm而不支持i386,因此,在构建模拟器时,我需要排除该文件的链接!
这可以做到吗?
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=*]" = ...
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.
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?
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!
Can this be done?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
基本上 EXCLUDED_SOURCE_FILE_NAMES 只会从该构建配置中删除这些文件
如果您想从构建配置中删除静态库,那么这就是要走的路。
要实现此目的,只需转到目标的“构建设置”,然后单击“添加构建设置”按钮并为目标添加 EXCLUDED_SOURCE_FILE_NAMES 配置。
然后您可以指定为每个构建配置排除哪些文件名...
在您的情况下,由于您提到了不同文件的列表,那么您可能应该创建 2 组应用程序包,然后排除 EXCLUDED_SOURCE_FILE_NAMES 中的包
所以如果您创建一个名为 Simulator.bundle 的包和一个名为release.bundle 的包,您将排除发布配置中的 Simulator.bundle 文件和模拟器配置中的release.bundle ...
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.
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...
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
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...