<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On Mar 20, 2013, at 7:24 AM, Fabien Sanglard <<a href="mailto:fabiensanglard.net@gmail.com">fabiensanglard.net@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">So the documentation at (<a href="http://clang.llvm.org/docs/UsersManual.html#usersmanual-precompiled-headers" target="_blank">http://clang.llvm.org/docs/UsersManual.html#usersmanual-precompiled-headers</a>) should be disregarded ?</blockquote><div><br></div><div>There's some misunderstanding, what I said was that you should follow the documentation and use an -include "precomp_common.h" option.</div><div> "precomp_common.h" should be multiple-includes-guarded (e.g. with a guard macro or "#pragma once") thus the #ifndef in</div><div><br></div><div><blockquote type="cite">#ifndef __clang__<br> #include "precomp_common.h"<br>#endif<br></blockquote><div><br></div><div>will be unnecessary.</div><div><br></div></div><blockquote type="cite"><div>
<br></div><div>Fabien<br><br><div class="gmail_quote">On Mon, Mar 18, 2013 at 9:41 PM, Argyrios Kyrtzidis <span dir="ltr"><<a href="mailto:akyrtzi@gmail.com" target="_blank">akyrtzi@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; position: static; z-index: auto; ">
<div style="word-wrap:break-word">On Mar 18, 2013, at 12:44 PM, fab <<a href="mailto:fabiensanglard.net@gmail.com" target="_blank">fabiensanglard.net@gmail.com</a>> wrote:<br><div><br><blockquote type="cite"><div style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing: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" target="_blank">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;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><br>I wonder if there is a "cleaner" way to do it.<br><br><br>
<span class="HOEnZb"><font color="#888888"><br>--<br>View this message in context:<span> </span><a href="http://clang-developers.42468.n3.nabble.com/Precompiled-header-without-prefix-header-tp4031029.html" target="_blank">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> </span><a href="http://nabble.com/" target="_blank">Nabble.com</a>.<br>_______________________________________________<br>cfe-dev mailing list<br><a href="mailto:cfe-dev@cs.uiuc.edu" target="_blank">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a></font></span></div></blockquote></div><br></div></blockquote></div><br></div>
</blockquote></div><br></body></html>