[webkit-dev] What's the rationale for not including config.h in any header files?

Keith Miller keith_miller at apple.com
Tue Aug 1 15:33:49 PDT 2017

That’s right if we end up going with C++ modules. We will either need to produce a replacement for config.h or have all root headers (i.e. headers that don’t include any other WebKit headers) include config.h. This is because with C++ modules the rule is that you have to include what you use. C++ modules basically precompile all the ASTs of your headers, which is not possible to do without all your macro/configuration definitions. 

I’m not sure there is a great replacement for a configuration header but perhaps we can come up with one. 


P.S. There is also a reasonable chance that we will do some form of unified sources (compiling multiple cpp files at the same time). In that case we don’t need to change our config.h rules.

> On Aug 1, 2017, at 2:12 PM, Ryosuke Niwa <rniwa at webkit.org> wrote:
> On Mon, Jul 31, 2017 at 1:27 PM, Darin Adler <darin at apple.com> wrote:
>> We originally adopted this “config.h” style to make WebKit buildable with autotools. Since that has not been a consideration for years I would be willing to abandon this and change how we do things.
>> I don’t think we should add lots of includes of “config.h”, though. I think we can come up with something better.
> As I understand it, we need to change the way we include config.h to
> enable C++ module in WebKit as well since each header file needs to be
> able to compile as its own module.
> - R. Niwa

More information about the webkit-dev mailing list