[Libreoffice] cui pre-compiled headers

Tor Lillqvist tlillqvist at novell.com
Sat Feb 12 12:24:56 PST 2011


> I noticed that the precompiled_cui.hxx file is just one big #if 0 ... #endif statement.

That should not matter because even if you drop the #if 0 ane corresponding #endif, it is still surrounded by #ifdef PRECOMPILED_HEADERS ... #endif, and that is not true either. I.e., we don't use pre-compiled headers, and the pre-compiled_cui.hxx header is effectively bypassed completely anyway.

Should we use pre-compiled headers? Maybe, in an ideal world, as it is said to speed up compilation on Windows a lot.

Did somebody think we were using them? No idea. At least I had never thought that we did, even if I knew that some such mechanism was used by Sun/Oracle, at least at some point, maybe even currently. (Note that there are clear signs in most source files that some mysterious pre-compiled-header related magic can be used: The "// MARKER(update_precomp.py): autogen include statement, do not remove" comments. Plus of course the */inc/pch/precompiled_*.* files.)

Just on Friday there was discussion on this in the IRC channel. I think Windows is the only platform where pre-compiled headers theoretically would be possible and make sense? If I understood correctly, using pre-compiled headers successfully is quite complex and hard, and as we haven't been using them so far, we presumably have in fact been doing changes to the sources without taking the appropriate care one apparently should if using pre-compiled headers.

To summarize: No, we don't use pre-compiled headers. Using them would speed up compilation on Windows, but my impression is that using them correctly and effectively would require a much heavier "process" than we want to be burdened with. Especially as most of our contributors are on Linux or other Unixes and don't want to be delayed by obscure Windows considerations.

--tml




More information about the LibreOffice mailing list