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
c ++ compiler-optimization compilation xcode clang


source to share


No one has answered this question yet

Check out similar questions:

1250
Replacing 32-bit loop counter with 64-bit values ​​leads to crazy performance deviations
870
Swift Beta: Sorting Arrays
471
Why is this program wrongly rejected by the three C ++ compilers?
427
Why are #ifndef and #define used in C ++ header files?
46
Including header files in C / C ++ more than once
8
Including C ++ 11 headers with Clang / LLVM
2
Including C ++ header files in Objective-C ++ when they conflict with Objective-C macros
1
Stop Apple clang from adding Xcode paths to standard include paths
0
How do I make the Makefile recompiled when the header file changes?
0
How can I "touch" all files that contain a particular header file?



All Articles
Loading...
X
Show
Funny
Dev
Pics