public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Determining PCH use
@ 2013-04-17 10:51 Miguel Guedes
  2013-04-17 14:49 ` Jeffrey Walton
  0 siblings, 1 reply; 3+ messages in thread
From: Miguel Guedes @ 2013-04-17 10:51 UTC (permalink / raw)
  To: gcc-help

Hello List,


I'm successfully generating a PCH but am not sure if it is being used as 
the project is built out of source. The generated `pch.hxx.gch' is 
created in the same directory as the `pch.hxx' header but everything else 
- objects, libraries, binaries, dependencies - are created out of 
source.    

Have tried passing the -H switch but I can't see the actual `pch.hxx.gch' 
PCH being used; only `pch.hxx' shows up in the long list of include 
files. 

Should the -H switch be showing the `pch.hxx.gch' PCH? If not, is there 
any other way of determining if the PCH is being used? Probably 
irrelevant but have also used `-Winvalid-pch' and no warnings are output.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Determining PCH use
  2013-04-17 10:51 Determining PCH use Miguel Guedes
@ 2013-04-17 14:49 ` Jeffrey Walton
  2013-04-17 15:24   ` Miguel Guedes
  0 siblings, 1 reply; 3+ messages in thread
From: Jeffrey Walton @ 2013-04-17 14:49 UTC (permalink / raw)
  To: Miguel Guedes; +Cc: gcc-help

On Wed, Apr 17, 2013 at 6:51 AM, Miguel Guedes
<miguel.a.guedes@gmail.com> wrote:
>
> I'm successfully generating a PCH but am not sure if it is being used as
> the project is built out of source. The generated `pch.hxx.gch' is
> created in the same directory as the `pch.hxx' header but everything else
> - objects, libraries, binaries, dependencies - are created out of
> source.
>
> Have tried passing the -H switch but I can't see the actual `pch.hxx.gch'
> PCH being used; only `pch.hxx' shows up in the long list of include
> files.
>
> Should the -H switch be showing the `pch.hxx.gch' PCH? If not, is there
> any other way of determining if the PCH is being used? Probably
> irrelevant but have also used `-Winvalid-pch' and no warnings are output.
In the past I used the following [hack]  in pch.hxx to verify use of
precompiled headers:

    #pragma message("Including precompiled header file.")

If it shows up once, then you are using precompiled headers. If it
shows up multiple times, you are not.

Jeff

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Determining PCH use
  2013-04-17 14:49 ` Jeffrey Walton
@ 2013-04-17 15:24   ` Miguel Guedes
  0 siblings, 0 replies; 3+ messages in thread
From: Miguel Guedes @ 2013-04-17 15:24 UTC (permalink / raw)
  To: noloader; +Cc: gcc-help

On Wed, 2013-04-17 at 10:49 -0400, Jeffrey Walton wrote:
> In the past I used the following [hack]  in pch.hxx to verify use of
> precompiled headers:
> 
>     #pragma message("Including precompiled header file.")
> 
> If it shows up once, then you are using precompiled headers. If it
> shows up multiple times, you are not.

Oh no, I've got a problem then - pragma message is output each time the
PCH header is included. Any tips on how I can go about diagnosing this
PCH non inclusion issue?

Many thanks for the pragma tip, Jeffrey!

-- 
Miguel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-04-17 15:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-17 10:51 Determining PCH use Miguel Guedes
2013-04-17 14:49 ` Jeffrey Walton
2013-04-17 15:24   ` Miguel Guedes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).