Xcode: Is there a location/flag to prevent a Class from compiling?

Is there a place (or flag) in Xcode for files that you don't want to compile? There are some classes that are/may become part of a project but currently won't compile. The main project doesn't link to them but Xcode still tries to compile them. Is there a way to prevent blocking the rest of project from compiling until these new Classes are "ready"?


Note that for every source file you can specify which target(s) it belongs to - look at the inspector window for a file (Get Info) and then hit the Targets tab. If you deselect a target for a given source file then it won't be compiled as part of the build process for that target.

[This amounts to much the same thing as what Eimantas has said in his answer - it's just a different way of looking at it.]

Look for unneeded files in "Compile sources" in Target -> {AppName} branch. Remove them from there and they won't be compiled on next build (make sure to Clean before you Build again)

You can use preprocessor statements:

#ifndef HIDE_<insert name here>



And then use:

#define HIDE_<insert name here>

above the aforementioned code in the files you don't want to compile.

In Xcode 8.3.3, in the utilities window, click on File Inspector tab at the top of the window. Uncheck the file in the Target Membership area of the File Inspector. Please see image below.

Need Your Help

how to change RGB to BGR

c bitmap jpeg rgb libjpeg

I am using libjpeg to decode a jpeg file and write it to a bitmap file.

Emit std::string with QThreads in Qt5. Q_DECLARE_METATYPE

multithreading types macros qt5

How do i define std::string as a type so i can emit from text from a QThread to another using a queued connection?