Select the most often used headers in project and put them into precompiled header
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Copyright (C) 2012 Łukasz Czerwiński


PCHGenerator is a tool to help generate precompiled header. It scans all source files in a project, selects the most frequently used headers and puts them into the precompiled header.



python >2.7

How to use it?

  1. Run to generate precompiled.h file
    $ -c="-I/usr/lib/boost" main.cpp test.cpp
    $ cat precompiled.h
    // File generated by  :
    // Compilation options: -I/usr/lib/boost
    // Project path       : /home/project*
    // Threshold          : 1
    // Exclude pattern    :
    // Exclude but pattern:
    #include "/ ... /include/c++/3.4.5/iostream"
    #include "/ ... /include/c++/3.4.5/vector"
  2. Compile precompiled.h into precompiled.gch
    $ g++ -I d:\boost precompiled.h
  3. Compile your project using prcompiled.gch according to the g++ manual. For details check here gnu g++ or here stackoverflow.


Maybe some day in the future I will do

  • add some support for CLang
  • add some support for Microsoft Visual C++