C++ Logo

sg15

Advanced search

Re: [isocpp-sg15] Module metadata distributed with pre-built libraries

From: Boris Kolpackov <boris_at_[hidden]>
Date: Thu, 23 May 2024 16:00:17 +0200
Daniel Ruoso via SG15 <sg15_at_[hidden]> writes:

> Requiring each project to build their own versions of the module objects
> is, pardon my bluntness, nonsensical.

Consider a library that only provides modules with inline/template
implementations. The object files produced for such modules will
be effectively empty. It feels wasteful to link, install, package,
etc., a library out of this empty object files.

FWIW, in build2 we by default always build a "binful" modular library
but the library author may explicitly request a "binless" library
(in which case the object files for module interfaces will be built
for each consumer). We do warn that if such modules contain any non-
inline/template functions or global variables, then whether the result
is usable is platform-dependent.

Received on 2024-05-23 14:00:08