Ticket #10 (new enhancement)

Opened 2 years ago

Last modified 2 years ago

Precompiled headers

Reported by: dirk Assigned to: dirk
Priority: major Milestone: 2.0 Release
Component: Build Version: 2.0
Keywords: Cc:
Completion:

Description

We need support for precompiled headers, both in the build system and for user apps.

Change History

10/15/06 14:22:46 changed by marcusl

I did some experiments today, and found that even by using both precompiled headers and "normal" inclusions, compiletimes where speed up greatly. This is because of the include guards.

I think that could work as a sort of middle ground. It will be a great improvement now for compilers that support it and it will still be backwards compatible. Futurewise, we could move to add external guards to some files that we know are precompiled.

Some .h/.cpp:

#ifndef OSG_SYSTEM_USE_PCH
#include <iostream>
#include <map>
#include <OSGBaseFoo.H>
#endif

Note that we have to #include the PCH-file in all cpp libs, topmost. And we have to use include guards in that file, because visual studio assumes everything up to and including the #include-statement is in the pch. So an #endif isn't allowed afterwards.

PCH.h

#ifdef OSG_SYSTEM_USE_PCH
#include ...
#endif