<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">On Mar 18, 2013, at 12:44 PM, fab <<a href="mailto:fabiensanglard.net@gmail.com">fabiensanglard.net@gmail.com</a>> wrote:<br><div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;">I am working on a cross-platform codebase on Clang/MacOS X that is also<br>compiled with Visual Studio on Windows and GCC on Linux.<br><br>The source code headers always include "precomp_common.h" at the top of each<br>header files. But according to the Clang documentation<br>(<a href="http://clang.llvm.org/docs/UsersManual.html#usersmanual-precompiled-headers">http://clang.llvm.org/docs/UsersManual.html#usersmanual-precompiled-headers</a>)<br>Clang will NOT use the PCH in this case and no speed up will be performed<br>since it was not include via "- include".<br><br>Using Clang it seems the only way is to perform a conditional include:<br><br>1.<br>#ifndef __clang__<br>  #include "precomp_common.h"<br>#endif<br><br>2. Add "precomp_common.h" to the prefix header via -include option.<br></div></blockquote><div><br></div><div>You don't need to do 1.; by doing 2. the "#include "precomp_common.h" will just be skipped.</div><br><blockquote type="cite"><div style="letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;"><br>I wonder if there is a "cleaner" way to do it.<br><br><br><br>--<br>View this message in context:<span class="Apple-converted-space"> </span><a href="http://clang-developers.42468.n3.nabble.com/Precompiled-header-without-prefix-header-tp4031029.html">http://clang-developers.42468.n3.nabble.com/Precompiled-header-without-prefix-header-tp4031029.html</a><br>Sent from the Clang Developers mailing list archive at<span class="Apple-converted-space"> </span><a href="http://nabble.com/">Nabble.com</a>.<br>_______________________________________________<br>cfe-dev mailing list<br><a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a></div></blockquote></div><br></body></html>