This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Compiling on MacOSX is too long


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]