Search code examples
xcodebuildcompilationprojectlinker-flags

Xcode how to exclude FOLDERS from compilation?


I saw this and answers in stackO, but didn't find how to exclude folders.

I have 3 folders with a lot of .h , .m and .mm and i need to exclude them temporary, but not to remove references. How can i do that?


Solution

  • From looking at the post you link to. Here is how you do it:

    1. Go to Build Settings.

    2. Press the plus button and select "Add User-Defined settings"

    enter image description here

    1. Give the new field the name of EXCLUDED_SOURCE_FILE_NAMES.

    enter image description here

    1. Add the path to the folder: <Path>/FolderToIgnore/*. The asterisk denotes all the file in the folder.

    enter image description here

    That should do it.

    Note: Make sure you add this to the right target.