[build2] C++ modules: how to generate the modules-list for own library

Wilhelm Meier wilhelm.meier at hs-kl.de
Wed May 10 12:38:36 UTC 2023

On 10.05.23 14:25, Boris Kolpackov wrote:
> Wilhelm Meier <wilhelm.meier at hs-kl.de> writes:
>> Can build2 solve this?
> Yes, I suggest that you study the example found here:
> https://github.com/build2/cxx20-modules-examples/
>  From your other emails I gather your approach is to write whatever
> first comes to your mind (like assigning some kind of mapping to
> cxx.modules) and expect this to work. While you are of course welcome
> to continue with this approach, I personally don't believe it is a
> wise way to spend time. As the saying goes, "hours of trail and error
> will save you minutes of reading the documentation and/or studying
> the examples".

Sorry for my dumb questions!

Studying the cited example gives me the solution ;-)

One additional question: I don't want to generate .o files from the 
module interface units, because they are "empty" (see my original posts 
of trying to port a header only libraray). So, I want to give the option 
"-fmodule-only" to the compiler for the *.mpp files and I don't want the 
.o files to be a prerequisite for the executable. How do I do that ?

Thanks in advance, and apologies for all the questions!

More information about the users mailing list