We are using a precompiled header to include library files such as Boost and Windows.
Our precompiled.h
is included explicitly at the top of each .cpp
file in order to work with the precompiled header commands (/Yc
, /Yu
, and /Fp
). I accepted that as necessary.
Recently, however, I found /FI
, which forces an include file at the top of the source file. I tried using it to force-include precompiled.h
instead of including it explicitly, and sure enough, it worked.
This would allow us to omit the precompiled header (which is an implementation detail, as far as I am concerned), and only specify the actual dependencies of the file.
Unfortunately, it looks like the only way to validate that we aren't relying on implicit dependencies provided by precompiled.h
is to periodically run through a build without /FI"precompiled.h"
to see which files have a problem.
This is fairly onerous. Is there a better way?