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

Boris Kolpackov boris at codesynthesis.com
Mon May 8 13:31:30 UTC 2023

Wilhelm Meier <wilhelm.meier at hs-kl.de> writes:

> I want to convert a own header-only library to a version using modules.
> Because it is a header-only library (mostly templates) I'm using module
> interface unit as *.cpp files in some directory structure. Seldom I split a
> module in module-partitions with more than one *.cpp file.
> If I want to use this modules, the build-tool needs a mapping between module
> names an the corresponding *.cpp files of our library.

Is this header-only library built with build2? If so, you (normally)
don't need an explicit mapping. For example, if your module interface
is in foo.cpp, then (normally) all you need is:

lib{foo}: mxx{foo.cpp}

More information about the users mailing list