Precompiled header - PCH

From Apache OpenOffice Wiki
Jump to: navigation, search

General

For general info see "Precompiled header" on Wikipedia


OOo build - PCH support

With the integration of cws ause060, "--enable-pch" will tell configure to enable precompiled header support for most modules, currently on windows only.

This is based on the include lines in every C/C++ file introduced by the pchfix* cws:


// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_<module_name>.hxx"


Unfortunatly, with enabled PCH the windows build will break in those modules on the first source file _NOT_ containing this include statement.

So if you're adding new sources, please make sure to fetch those lines from one of your neighbour sources and place them in your new file as _FIRST_ include made.


FAQ

Q: Are the .pch files automatically updated when i'm building?

A: They are updated every time you enter <module>/inc and call "dmake". This automatically happens when using the "build" command. All build.lst have been changed accordingly


Q: Why aren't they updated by "dmake" before starting to compile?

A: That could be possible in future times but holds the risc that several dmake calls may try to update/write the same file...


Q: Can't we use compilerswitch "-XY" to avoid the "precompiled_<module_name>.hxx" include in every sourcefile?

A: Just make suggestions! This would of cause make using PCH more stable. Already tried "-FI<filename>" for "wntmsci10" but it didn't help.


Q: When will PCH support be available on <platform>?

A: The current PCH support is designed to have one set of compiler switches to create .pch (or whatever they may be named) files and one set of switches for using them (see solenv/inc/wntmsci10.mk). So if anyone finds the time to lookup these switches to make <platform> work in a similar way - PCH support should be there.

Personal tools