C++ Logo

sg15

Advanced search

Re: [Tooling] [ Modules and Tools ] Tracking Random Dependency Information

From: Boris Kolpackov <boris_at_[hidden]>
Date: Wed, 19 Dec 2018 10:58:21 +0200
Colby Pike <vectorofbool_at_[hidden]> writes:

> Modern build tools such as Ninja grab the dependency information for a
> translation unit as part of invoking the compiler command, not by running
> the preprocessor separately. I'm preparing a post on how Ninja builds and
> performs dependency analysis, which I believe is the currently optimal way
> to do it.

This "header dependency information as a by-product of compilation"
approach has a number of problems:

1. It can't handle auto-generated headers.

2. It doesn't fit well with implementing support for distributed
   compilation or ignorable change detection.

3. It won't work for C++ modules, unless you are prepared to go with the
   "compiler calls back into the build system" approach.

So I believe next-generation C++ build systems will instead use a
different compilation model (and build2 already does). This fragment
from my CppCon talk has the details:

https://youtu.be/cJP7SSLjvSI?t=2332


> There may be some tweaks with the addition on modules, but it will still
> be applicable.

I would be interested to learn how this will work.

Received on 2018-12-19 09:58:29