C++ Logo

sg15

Advanced search

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

From: Chuanqi Xu <chuanqi.xcq_at_[hidden]>
Date: Tue, 17 Oct 2023 10:29:02 +0800
Hi Daniel,
> The concept of local preprocessor arguments applies to named modules as well, not just to header units.
I got the point now after I read P2581 again. This shocked me for a while since I always think the named module interface is simply another TU in the project and we can/should specify its flags like any other TU we did. And this is what CMake does IIUC.
But your point makes sense with third party modules.
Thanks,
Chuanqi
Thanks,
Chuanqi
------------------------------------------------------------------
From:Daniel Ruoso <daniel_at_[hidden]>
Send Time:2023 Oct. 16 (Mon.) 16:25
To:sg15 <sg15_at_[hidden]>
Cc:Chuanqi <chuanqi.xcq_at_[hidden]>
Subject:Re: [SG15] P2962R0: Communicating the "Baseline Compile Command" for C++ Modules support
On Mon, Oct 16, 2023, 03:57 Chuanqi Xu via SG15 <sg15_at_[hidden] <mailto: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-17 02:29:10