C++ Logo

sg15

Advanced search

Re: P2962R0: Communicating the "Baseline Compile Command" for C++ Modules support

From: Daniel Ruoso <daniel_at_[hidden]>
Date: Mon, 16 Oct 2023 10:25:06 +0200
On Mon, Oct 16, 2023, 03:57 Chuanqi Xu via SG15 <sg15_at_[hidden]>
wrote:

> Thanks for the paper. My instinct reaction to the paper is that it sounds
> better to rename `C++ Modules` to `Header Units` in the title (and other
> places). IIUC, the paper itself has nothing to do with named modules. So a
> narrower title may be helpful to understand
>

The concept of local processor arguments applies to named modules as well,
not just to header units.

The later section on static analysis tools is an example of why it's
important in that space as well.

This was previously discussed on P2581R2, which went into greater details
on this point.


  My reaction to the line is: so we (the tools) don't need an explicit
> baseline compile command. It looks not hard to extract the `baseline
> command` from the actual command line.
>

Static analysis tools need to be able to assemble its own build plan for
BMIs. But I think the missing context here is the paper I mentioned above.

Here we can find `-DBAR=2` and `-I/other/path` is not presented in the
> `baseline-arguments`. Then I got confused about the definition of the
> baseline compile command. Also I am wondering how should the build systems
> to understand what `-D` and `-I` options should be put into the
> `baseline-arguments` and what shouldn't.
>

That information has to be authored by the user. There is no way for the
tooling to decide that.

Essentially the concept of "Local Preprocessor Arguments" needs to be a
first class concept in the build system (but again, this paper is building
on previous work).

Daniel

Received on 2023-10-16 08:25:19