Re: [gtkmm] precompiled headers [revisited]



> Cumming External comneon com wrote:
>>>but I still think
>>>it'd be rather interesting to have a build target for
>>>gtkmm.h.pch in the
>>>standard gtkmm makefile.
>>
>>
>> Probably, yes. A patch would be welcome.
>>
>
> After further investigation it turns out that this is not a very good
> idea. In order for precompiled headers to work, the including compiler
> need to be the exact same version, have the same configuration and in
> some cases even have the same compiler options as the compiler used to
> build the precompiled header file.

The same is true of the shared library, so I see no problem with this.

> This means that it's preferred to let the applications build their own
> private precompiled gtkmm.h tailored to the specific compiler
> environment used by the application.
>
> An example showing how an application would do that would be easy to
> cook up, though.
>
> One small problem; the existing gtkmm examples are an integrated part of
> the gtkmm build. To be useful, I think such an example should have its
> own independent build environment (i.e. have its own
> configure.ac/configure.in, etc.). OTOH, I think this will be very useful
> in other respects as well. Perhaps we should provide a generic "build"
> example that shows how to properly set up the GNU autotools, etc. in
> addition to showing how to use a precompiled gtkmm.h?

gtkmm_hello already exists. You could adapt it to use precompiled headers.
We could maybe just comment-it out, with an explanation for people who
want to use it.






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