Xcode: is there a location / flag to prevent class compilation?

Is there a place (or flag) in Xcode for files you don’t want to compile? There are some classes that / may become part of the project, but will not compile at this time. The main project is not related to them, but Xcode is still trying to compile them. Is there a way to prevent the rest of the project from compiling until these new classes are “ready”?

+7
compiler-construction cocoa-touch xcode cocoa
source share
4 answers

Please note that for each source file you can indicate what purpose (s) it belongs to - look at the inspector window for the file (Get Info), and then click the Goals tab. If you deselect a target for a given source file, it will not be compiled as part of the build process for that purpose.

[It's almost the same as Eimantas said in his answer - it's just another way to look at it.]

+11
source share

Look for unnecessary files in the "Compile Sources" section in the Target branch → {AppName}. Remove them from there and they will not be compiled in the next build (be sure to clean before you start the build again)

+6
source share

You can use preprocessor instructions:

#ifndef HIDE_<insert name here> CODE #endif 

And then use:

 #define HIDE_<insert name here> 

above the above code in files that you do not want to compile.

0
source share

In Xcode 8.3.3, in the utilities window, click the File Inspector tab at the top of the window. Uncheck this box in the Target Membership area of ​​the File Inspector. See image below.

enter image description here

0
source share

All Articles