Disabling Some Files in Xcode Project from Compilation

Xcode how to exclude FOLDERS from compilation?

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"

Sample Image


  1. Give the new field the name of EXCLUDED_SOURCE_FILE_NAMES.

Sample Image


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

Sample Image

That should do it.

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

Disable ARC for entire nested project in xcode

If you want to disabled for the whole project, go to your target's build settings and set Objective-C Automatic Reference Counting to No.

Like this:

Sample Image

In Xcode, how to suppress all warnings in specific source files?

Select your target and show Build Phases. Then enter the name of the file in the search box, and you should see it listed in the Compile Sources phase. Double-click in the Compiler Flags column for that file and enter -w to turn off all warnings for that file.

How can I disable ARC for a single file in a project?

It is possible to disable ARC for individual files by adding the -fno-objc-arc compiler flag for those files.

You add compiler flags in Targets -> Build Phases -> Compile Sources. You have to double click on the right column of the row under Compiler Flags. You can also add it to multiple files by holding the cmd button to select the files and then pressing enter to bring up the flag edit box. (Note that editing multiple files will overwrite any flags that it may already have.)

I created a sample project that has an example: https://github.com/jaminguy/NoArc

xcode

See this answer for more info:
Disable Automatic Reference Counting for Some Files

How to set compiler flags in Compile Sources to omit a file from a build configuration

You need to set "Other Swift Flags" in your target's Build Settings to -D DEBUG so you can use the "#if/#else/#endif" preprocessor macros.

How can I disable ARC for an entire group/folder of files?

Goto Build Phases -> Compile sources select multiple files holding command ⌘ and press enter then add the value -fno-objc-arc It will reflect for all the selected files.



Related Topics



Leave a reply



Submit