Why does clang recompile all C ++ files, including the header file, if the last change doesn't affect most of them?

I have a Constants header file that is included in most of my source files. If I change the constant in there, which is only used by ~ 2 source files, then Clang will still recompile all ~ 300 source files that include this header file.

Is there a way to recompile the source files that were really affected by the change I made without breaking the Constants file into many tiny pieces? I would really like to speed up the compilation process after small changes.

Since my build system and environment seem to matter: I am using Xcode 8.3.3 on OSX, compiling C ++ code for iOS.

+3


source to share





All Articles