开发者

How do I use EXCLUDED_SOURCE_FILE_NAMES in XCode 4 (iOS)

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 docum开发者_运维问答entation 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?


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...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜