C++ Logo

sg15

Advanced search

Re: Header units again.

From: Gabriel Dos Reis <gdr_at_[hidden]>
Date: Thu, 13 Oct 2022 19:37:40 +0000
> Yes, but we can't then add a rule to `build.ninja` to say "hey, make a
> BMI of this header file no one knew about until we started building
> stuff".

I suppose that raises the question: at what point do you run the dependency scanner? During build?

-- Gaby

-----Original Message-----
From: Ben Boeckel <ben.boeckel_at_[hidden]>
Sent: Thursday, October 13, 2022 12:34 PM
To: Gabriel Dos Reis <gdr_at_microsoft.com>
Cc: sg15_at_[hidden]
Subject: Re: [SG15] Header units again.

On Thu, Oct 13, 2022 at 19:02:19 +0000, Gabriel Dos Reis wrote:
> > While fine, that is discovered far too late for CMake to do much of
> > anything about (as the build graph is already made at this point and is
> > static in Ninja generators; Makefiles is more flexible, but needs
> > serious synchronization to avoid duplicate rule generation).
>
> What do you mean by "too late"? If a source file (.h or .cpp) says
> "import <some-header>;", that shows up in the output of the dependency
> scanner, doesn’t it?

Yes, but we can't then add a rule to `build.ninja` to say "hey, make a
BMI of this header file no one knew about until we started building
stuff".

--Ben

Received on 2022-10-13 19:37:42