C++ Logo

sg15

Advanced search

Re: [Tooling] Clang Modules and build system requirements

From: Mathias Stearn <redbeard0531_at_[hidden]>
Date: Fri, 8 Feb 2019 00:58:38 -0500
On Fri, Feb 8, 2019 at 12:33 AM Tom Honermann <tom_at_[hidden]> wrote:

> A couple of people have countered that build system updates are required
> (presumably in excess of just adding '-fmodules' to Clang invocations) in
> order to enable support for Clang Modules. This seems trivially incorrect
> to me, so long as one does not consider Clang's module.modulemap files to
> be part of the build system (I don't; they are tool specific configuration
> files that the build system does not need to be aware of).
>

I would hope you are marking the module.modulemap as an input dependency of
every compilation that uses -fmodules. If you don't then you are risking
silent miscompilation which is about the worst thing a build system can do.
And if you are, that means that you have either manually added it as an
input edge to every compile (unlikely), or you modified your build system
to teach it to do that automatically*. I assume you are primarily referring
to deeper structural changes, but your implication that you can just add
-fmodules to CXXFLAGS and walk away seems trivially incorrect to me.

*Technically there is an additional option: your build system monitors for
every file that the compiler opens (eg by LDPRELOAD) and automatically adds
the modulemap file as an input edge. But I don't think you are intending to
require every build system to do that.

Received on 2019-02-08 06:58:52