[cfe-dev] Precompiled header without prefix header ?

fab fabiensanglard.net at gmail.com
Mon Mar 18 12:44:33 PDT 2013

I am working on a cross-platform codebase on Clang/MacOS X that is also
compiled with Visual Studio on Windows and GCC on Linux.

The source code headers always include "precomp_common.h" at the top of each
header files. But according to the Clang documentation
Clang will NOT use the PCH in this case and no speed up will be performed
since it was not include via "- include".

Using Clang it seems the only way is to perform a conditional include:

#ifndef __clang__
   #include "precomp_common.h"

2. Add "precomp_common.h" to the prefix header via -include option.

I wonder if there is a "cleaner" way to do it.

View this message in context: http://clang-developers.42468.n3.nabble.com/Precompiled-header-without-prefix-header-tp4031029.html
Sent from the Clang Developers mailing list archive at Nabble.com.

More information about the cfe-dev mailing list