How can I conditionally include a file based on build configuration in Xcode?

后端 未结 6 1731
时光取名叫无心
时光取名叫无心 2020-12-07 08:06

I have an Xcode project with a large number of targets where I would like to include a settings bundle for apps built under the Ad-hoc and Debug configurations, but not unde

6条回答
  •  无人及你
    2020-12-07 08:25

    For complied sources, there is a poorly documented user defined build setting that can be added. Files can be both excluded and included from compilation

    Go to your target's Build Settings > Tap the + button > Add User-Defined Setting

    The key is either INCLUDED_SOURCE_FILE_NAMES or EXCLUDED_SOURCE_FILE_NAMES

    The value is a space separated list of file paths

    See reference: http://lists.apple.com/archives/xcode-users/2009/Jun/msg00153.html

提交回复
热议问题