Is there a way for the preprocessor to determine if the code in the current translation unit uses (or creates) precompiled headers?
The actual problem that I am currently facing is that I am in a project that is abusing PCH by pre-compiling almost all header files.
This means that there is no explicit dependency management that you can get from #includes and the compilation time is terrible. Almost every change will cause a complete restructuring.
An application is a way to do this simply to just fix it at a time, and some of the older guys refuse to believe that precompiling each of them is bad. First I need to prove it.
Therefore, I have to do this step by step and make sure that my changes do not affect the code that was compiled in the old PCH way.
My plan is to make an ifdef from PCH.h and work with the version without PCH when I have time to save.
#ifdef USES_PCH #include "PCH.h" #elif
I would like to avoid defining USES_PCH on the command line and manually keep it in sync with / Y, which, in addition to being not very elegant, would be a pain. There are many configurations and modules for juggling and a large number of files that do not match the project defaults.
source share