From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by sourceware.org (Postfix) with ESMTPS id BA54E3858D39 for ; Tue, 19 Oct 2021 16:46:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org BA54E3858D39 Received: by mail-wm1-x32a.google.com with SMTP id o24-20020a05600c511800b0030d9da600aeso4087416wms.4 for ; Tue, 19 Oct 2021 09:46:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Kxi+Cf/BArIHLNNl2/5G4bmmB7z7l6DQXjIpqFaUMjA=; b=RpyFFGsfsciF8ZyggN+9cV/9VqPzsNI/kjk1AHdWV9VgCjXWbPcAyj4Huiq9NwRZ+F C2RjYMJbX9as2gFW8Pu5C+UuFYFRm+6CZAuR6d/qqiykkBKjvs0hFg4zD9vXFZfJzn4I eLATzVOc4ZymQ4EptPy/ZYHxSzjFEC715bFKSzHmrKvaXB9rV+cy0gZ7z+61xZkgUqir cKBK7onerjLtelG/alomdo3AQGS3IcVotrLaxEV7vfBdbu4BzqNakrp0cwZIMDSHtC+8 PIkXtYlRMSCuaF7tkIRUYJ4MOKmHeTqhoZYEUAlmHUn5XoB3MR4kBlOKafcKDlS8eXoo fI9g== X-Gm-Message-State: AOAM530mb3fplRIUwhl38XCcJ+tVT1DhuEDd1kebWT5lm5Nosyz6Br1S +m1XvR42O/KC3I0QqYU95MzWLQvufIRIm3OuTuA= X-Google-Smtp-Source: ABdhPJw64h3oeok2TAPKJ9HSP0ptHWGSBPbJ1K3et8mf09T7n6EyRm+myaeewY2WtxeZpdZnxoPnPgM6IeUVgvkz2fs= X-Received: by 2002:a5d:4643:: with SMTP id j3mr28107528wrs.297.1634661970631; Tue, 19 Oct 2021 09:46:10 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Andrew Jones Date: Tue, 19 Oct 2021 17:45:59 +0100 Message-ID: Subject: Re: C++20 module mapper To: Alexander Christensen Cc: "gcc-help@gcc.gnu.org" Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-help@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-help mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Oct 2021 16:46:13 -0000 Hi Alexander, Actually, I've done some work on this: https://github.com/andrewvaughanj/cpp20_module_examples and more specifically: https://github.com/andrewvaughanj/cpp20_module_examples/blob/main/do_gcc.sh Please take a look and feel free to ask if you have any questions -- cheers, Andrew On Tue, Oct 19, 2021 at 4:58 PM Alexander Christensen via Gcc-help wrote: > > 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 >