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.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
tests
LICENSE
README.md
dag.py
gcc_facade.py
headers_dag.py
pch.py
process_argv.py
recursive_filter.py
should_be_in_pch.py
stack.py
topological_sorter.py

README.md

Copyright (C) 2012 Łukasz Czerwiński

PCHGenerator

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.

Website

https://github.com/wo3kie/pchGenerator

Requirements

python >2.7

How to use it?

  1. Run pch.py to generate precompiled.h file
    $ pch.py -c="-I/usr/lib/boost" main.cpp test.cpp
    
    $ cat precompiled.h
    // File generated by  : pch.py
    // 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.

Todo

Maybe some day in the future I will do

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