C++ Logo

sg15

Advanced search

Re: Header units again.

From: Michael Spencer <bigcheesegs_at_[hidden]>
Date: Thu, 13 Oct 2022 14:05:25 -0700
On Thu, Oct 13, 2022 at 12:37 PM Gabriel Dos Reis via SG15 <
sg15_at_[hidden]> wrote:

> > 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
>

CMake runs the scan during the build. They have to know about all possible
BMIs during configuration.

- Michael Spencer


>
> -----Original Message-----
> From: Ben Boeckel <ben.boeckel_at_[hidden]>
> Sent: Thursday, October 13, 2022 12:34 PM
> To: Gabriel Dos Reis <gdr_at_[hidden]>
> 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
> _______________________________________________
> SG15 mailing list
> SG15_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/sg15
>

Received on 2022-10-13 21:05:40