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

Wilhelm Meier wilhelm.meier at hs-kl.de
Sun May 7 08:31:28 UTC 2023


Hi Boris,

On 05.05.23 12:28, Boris Kolpackov wrote:
> Wilhelm Meier via users <users at build2.org> writes:
> 
>> Actually I have to migrate an own header-only C++ library (for embedded
>> devices) to C++ modules. As I read in to build2  documentation, the library
>> has to provide a modules list in the form <module>=<path> ...
> 
> Hm, can you point out which documentation gave you this impression?
> 
> I am guessing you are referring to the pkg-config (.pc) files that need
> to contain this information for installed libraries. These files are
> generated automatically by build2. For details, see:
> 
> https://build2.org/blog/build2-cxx20-modules-gcc.xhtml#libraries
> 

Yes, exactly. Mayby I misinterpreted the doc.

What I'm trying to do is the following:

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.

The question is: can this mapping be built by an existing tool?



More information about the users mailing list