automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: precompiled headers


From: Per Rosengren
Subject: Re: precompiled headers
Date: Fri, 18 Apr 2008 15:25:46 +0200
User-agent: Thunderbird 2.0.0.12 (X11/20080227)

The compiler flags given when compiling a source file that uses a precompiled header must match those used when the precompiled header was compiled. Because of this I altered Brian's code to:

BUILT_SOURCES = myheader.hh.gch
%.hh.gch: %.hh
        $(CXXCOMPILE) -c $<

The only difference here is that CXXCOMPILE - which is used to compile my sources, adds some flags to CXX.
For debugging purposes, I added

AM_CXXFLAGS = -H -Winvalid-pch

where -H prints all header files included, and -Winvalid-pch warns if a precompiled header was found but not used.

I think all dependencies are correct.


Thank you!
Per

Ralf Wildenhues wrote:
* Brian Dessent wrote on Fri, Apr 18, 2008 at 11:28:07AM CEST:
BUILT_SOURCES = myheader.hh.gch
%.hh.gch: %.hh
        $(CXX) -c $<
[...]
The rule is a good start, but likely lacking dependency information.

But honestly the above is just a random stab at how to start, you'd be
much better asking on the automake list (in CC:.)

My humble musings about precompiled headers support are mostly in
<http://thread.gmane.org/gmane.comp.gcc.devel/60371>, and those
affect GCC-type precompiled headers only.

Cheers,
Ralf




reply via email to

[Prev in Thread] Current Thread [Next in Thread]