This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Compiling on MacOSX is too long
- From: Eljay Love-Jensen <eljay at adobe dot com>
- To: Exxos Sir <thomastrewas at yahoo dot fr>, gcc-help at gcc dot gnu dot org
- Date: Thu, 02 Sep 2004 06:47:53 -0500
- Subject: Re: Compiling on MacOSX is too long
- References: <20040902083230.53248.qmail@web50102.mail.yahoo.com>
Hi,
>The builds are too long.
Some builds take a long time.
There are several techniques you can employ to reduce build times.
+) In your header files, try to use forward references where possible,
instead of including the header files.
+) To improve on #1, make "header-header" files. These files contain the
forward references, and maybe a smattering of other public facilities (such
as enums). Use the header-headers in your header files. The header that
that the header-header represents should be the first thing included by the
actual header file.
+) Put guards in all your header files.
+) Include all the headers (or header-headers) that your header or source
file requires. Do not include anything beyond that!
+) Do not make "kitchen sink header files", which include everything.
+) Used the "pointer-to-implementation" technique (the "pimpl pattern"), to
reduce rebuild time.
+) Follow Lako's suggestions, Large-Scale C++ Software Design
<http://www.amazon.com/exec/obidos/tg/detail/-/0201633620>.
+) Follow Peter Miller's suggestions, Recursive Make Considered Harmful
<http://www.tip.net.au/~millerp/rmch/recu-make-cons-harm.html>.
HTH,
--Eljay