public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Alexander Christensen <alex_c007@hotmail.com>
To: "gcc-help@gcc.gnu.org" <gcc-help@gcc.gnu.org>
Subject: C++20 module mapper
Date: Tue, 19 Oct 2021 15:58:06 +0000	[thread overview]
Message-ID: <AM0PR09MB4291C408CB2B41171881751DD4BD9@AM0PR09MB4291.eurprd09.prod.outlook.com> (raw)

Hi, I hope I write to the right place.

I would like to know how to use the module mapper, documented here https://gcc.gnu.org/onlinedocs/gcc/C_002b_002b-Module-Mapper.html,
to change the location of the expected gcm.cache directory. Given an example project layout:

src/
    Makefile
    project_1/
        // .cpp source files
        Makefile
    project_2/
        // .cpp source files
        Makefile

Compiling from inside project_1 and project_2 folders does not work with the default module mapper, as gcc expects the module cache
to be located in current working directory, which is a problem if project_2 references modules built in project_1.
However, I can specify a module-mapping file. But I can't get it to work.

What would be the correct syntax for such a file, located in project_2, to override the default module cache to read from modules in
src/gcm.cache/ and NOT src/project_2/gcm.cache/ ? This does not work:

// module_mapping.txt
'$root' ../gcm.cache/

And I do not want to prepend "cd .. && " to all build commands in src/project_2/Makefile.


Sincerely,
Alexander


             reply	other threads:[~2021-10-19 15:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-19 15:58 Alexander Christensen [this message]
2021-10-19 16:45 ` Andrew Jones
     [not found]   ` <AM0PR09MB4291BC30DF53A60DBAA2FED9D4BD9@AM0PR09MB4291.eurprd09.prod.outlook.com>
2021-10-19 22:48     ` Andrew Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AM0PR09MB4291C408CB2B41171881751DD4BD9@AM0PR09MB4291.eurprd09.prod.outlook.com \
    --to=alex_c007@hotmail.com \
    --cc=gcc-help@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).