This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Creating one large precompiled header from multitude of other (possibly also precompiled) headers.
- From: "Andy Falanga (afalanga)" <afalanga at micron dot com>
- To: leon zadorin <leonleon77 at gmail dot com>, gcc-help <gcc-help at gcc dot gnu dot org>
- Date: Mon, 4 Apr 2016 14:32:00 +0000
- Subject: Re: Creating one large precompiled header from multitude of other (possibly also precompiled) headers.
- Authentication-results: sourceware.org; auth=none
- References: <CAPpySAY+swMUZpiRksic6pDezxgL=YWBD_3XW+ZxKXyhseFenQ at mail dot gmail dot com>
On 03/31/2016 05:12 PM, leon zadorin wrote:
> Hello and pardon the nativity of question given that I didn't look at
> the internals of GCC's precompiled header implementation...
>
> I am aware that GCC considers a precompiled header file (e.g. x.h.gch)
> when looking for a usual, included, header file (e.g. #include "x.h").
>
> So the question is: when creating one large precompiled header such as
> all.h.gch where all.h #includes x.h, y.h, z.h, etc. -- will GCC be
> able to accelerate the process of creating all.h.gch if it sees that
> x.h itself already has a precompiled version such as x.h.gch?
>
> Best regards
> Leon.
There are others here who know better than I. That said, from this link
to gcc docs:
https://gcc.gnu.org/onlinedocs/gcc-4.8.5/gcc/Precompiled-Headers.html#Precompiled-Headers
, I would say: no. Consider:
* Only one precompiled header can be used in a particular compilation.
This is the very first bullet in the docs when they discuss restrictions.
Andy