This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
[PCH] Automatic PCH creation model
- From: Karel Gardas <kgardas at objectsecurity dot com>
- To: GCC Mailing List <gcc at gcc dot gnu dot org>
- Date: Thu, 28 Aug 2003 14:15:01 +0200 (CEST)
- Subject: [PCH] Automatic PCH creation model
Hello,
I would like to ask if anybody is working on automatic PCH creation - like
it is working in Comeau's C/C++ compiler and IIRC in Borland's C++
compiler. e.g. let's have some options which directs usage of pch -
``--pch'' and ``--pch_dir'', then for example
c++ <params> --pch -c a.cc
will create a.pch in the same dir like it creates a.o. Also if the next
command is:
c++ <params> --pch -c b.cc
and the a.pch is suitable for reuse in b.cc compilation, then it is used.
If it is not, then b.pch is created. In the process of source unification,
there are some #pragmas which might be used to directs pch processing,
like #pragma hdrstop and #pragma no_pch. In case of #pragma no_pch, pch
usage will be disabled for this file and in case of #pragma hdrstop, pch
processing - i.e. the set of include files till the #pragma hdrstop will
be used to find the best matching pch file. More about this scenario is
written in como documentation on
http://www.comeaucomputing.com/4.0/docs/userman/pch.html.
The ``--pch_dir'' option specifies directory where generated pch files
will be stored and searched.
The reason why I'm asking this question is, that IMHO from C/C++ user/app
developer, there is easy way to use automatic pch creation model, than
manual creation model like this currently supported by gcc.
Please don't get me wrong, it is great that gcc does have at least some
way to use pch, but I have in mind a lot of free software projects which
not only will need to do some changes in sources, but also will need to do
some changes in build framework to benefit from this nice feature.
Thanks a lot for your work!
Karel
--
Karel Gardas kgardas@objectsecurity.com
ObjectSecurity Ltd. http://www.objectsecurity.com