Hi all,

Should we add PCH support for OSG?

MSVC is not the fastest compiler on earth, but has support for a precompiled 
headers (PCH) to compensate and speed up the build. I'm not here to debate 
about the design of PCH(*), but I must admit it could significantly decrease 
compile time under Windows/MSVC. I've heard some other compilers have the same 
support too (Borland?). CMake doesn't have native support for these, but I've 
been successful in adding it in CMake scripts (and cut the build time by more 
than 2). It's not very difficult.

Question is: should I/we add this (optional) support for OSG?
The main drawback is that you must tell the compiler to virtually add an 
include at the top of each .cpp. That is to say, when PCH are enabled, you may 
successfully compile a .cpp that would not compile otherwise. Example:
- Precompiled.h contains #include <string>
- Foo.cpp uses std::string without including <string>
Then if Foo.cpp uses the PCH, Precompiled.h will be silently and virtually 
added ontop of it, thus making it compilable.
Thus, submitters that use *only* MSVC should check that compilation is ok 
without PCH before submitting, or else Robert may sometimes have to add 
"#include" directives before merging.

Thoughts?

Cheers,

(*) Even if I've got many (bad) things to say!

Sukender
PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to