public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* auto generate dependencies for modules-ts
@ 2021-09-15  9:45 Klaus Rudolph
  2021-09-15 10:59 ` Jonathan Wakely
  0 siblings, 1 reply; 2+ messages in thread
From: Klaus Rudolph @ 2021-09-15  9:45 UTC (permalink / raw)
  To: gcc-help

If we want to use import <iostream>; instead of old style #include
<iostream> we need to "precompile" the iostream header file. We can do
it manually by simply invoking g++ with:

     g++ -xc++-system-header -std=c++20 -fmodules-ts iostream

But this needs a manually created set of rules for all used system
header files for gnu make with all the dependencies pointing to the
gcm.cache directory structure.

In case of old style #include directives, we simply have the -M or -MM
flags to generate such dependencies for make automatically.

Q: How we can get such dependencies from g++ for imported modules
automatically to set up the rules for gnu make?

The target is quite simple: Get all needed .gcm files precompiled before
the build system needs these files for import.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: auto generate dependencies for modules-ts
  2021-09-15  9:45 auto generate dependencies for modules-ts Klaus Rudolph
@ 2021-09-15 10:59 ` Jonathan Wakely
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Wakely @ 2021-09-15 10:59 UTC (permalink / raw)
  To: Klaus Rudolph; +Cc: gcc-help

On Wed, 15 Sept 2021 at 10:46, Klaus Rudolph wrote:
>
> If we want to use import <iostream>; instead of old style #include
> <iostream> we need to "precompile" the iostream header file. We can do
> it manually by simply invoking g++ with:
>
>      g++ -xc++-system-header -std=c++20 -fmodules-ts iostream
>
> But this needs a manually created set of rules for all used system
> header files for gnu make with all the dependencies pointing to the
> gcm.cache directory structure.
>
> In case of old style #include directives, we simply have the -M or -MM
> flags to generate such dependencies for make automatically.
>
> Q: How we can get such dependencies from g++ for imported modules
> automatically to set up the rules for gnu make?
>
> The target is quite simple: Get all needed .gcm files precompiled before
> the build system needs these files for import.

The expected process is to get Make to do that for you, not to set it
all up in advance. But it's just a proof of concept so far, see the
last paragraph of
https://gcc.gnu.org/onlinedocs/gcc/C_002b_002b-Module-Mapper.html

I think there is no solution to the problem using the current released
versions of the tools, you have to do it all manually.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-09-15 10:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-15  9:45 auto generate dependencies for modules-ts Klaus Rudolph
2021-09-15 10:59 ` Jonathan Wakely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).