PCH on Qt

Qt uses gcc's PCH directory, where various PCH files (for different languages) are all emitted in a common 'precompiled_header.gch' directory and if you do
"-include precompiled_header.h"
all PCH files are considered in alphabetical order and the first suitable one is used.

Do we want to support that ? It is complicated in our current architecture.

A simpler way would be, when adding support for clang compiler in Qt's build system, to inform Qt about clang's PCH way.
That would just need a '-include-pch' driver option so that Qt can just pass the PCH file that should be used (currently I "simulate" this using -Xclang -include-pch -Xclang filename).

Thoughts ?

-Argiris

Just adding a clang specific mkspec to Qt sounds like a better idea.

Regards,
ismail

Qt uses gcc’s PCH directory, where various PCH files (for different languages) are all emitted in a common ‘precompiled_header.gch’ directory and if you do
“-include precompiled_header.h”
all PCH files are considered in alphabetical order and the first suitable one is used.

Do we want to support that ? It is complicated in our current architecture.

A simpler way would be, when adding support for clang compiler in Qt’s build system, to inform Qt about clang’s PCH way.
That would just need a ‘-include-pch’ driver option so that Qt can just pass the PCH file that should be used (currently I “simulate” this using -Xclang -include-pch -Xclang filename).

Just adding a clang specific mkspec to Qt sounds like a better idea.

Yep, for Qt this is much better.
I’m mainly asking whether we are interested in supporting PCH directories in general, so that clang can be a drop-in replacement for projects that use them. Though PCH directories doesn’t seem to be much popular since there were no complains about not supporting them.

Already done:

http://gitorious.org/~elcuco/qt/llvm-support

Great idea. I will see how PCHs are implemented in Qt’s build system and see what I can do.