C++ Logo

sg15

Advanced search

Re: Provide build systems with ways to build the std(.compat) modules

From: Mark de Wever <koraq_at_[hidden]>
Date: Wed, 12 Jul 2023 20:36:35 +0200
On Sun, Jul 09, 2023 at 10:42:13AM -0400, Ben Boeckel wrote:
> On Sun, Jul 09, 2023 at 14:00:11 +0200, Mark de Wever wrote:
> > On Thu, Jul 06, 2023 at 07:00:45PM -0400, Ben Boeckel wrote:
> > > On Sun, Jul 02, 2023 at 17:41:29 +0200, Mark de Wever via SG15 wrote:
> > > > Libc++ has std.cppm, std/<header>.cppm for every header, and a
> > > > CMakeLists.txt. In order to build the BMI clang needs to use special
> > > > build flags. For example, -Wno-reserved-module-identifier is needed to
> > > > allow building modules with implementation reserved names. AFAIK
> > > > specifying build flags is not possible in the p1689 format without
> > > > vendor extensions.
> > >
> > > Nor is it intended to. Note that extensions are, de jure, ignorable. In
> > > CMake terms, this would be part of the relevant `CMake::CXX23` (or
> > > whatever color that bikeshed gets painted) target that references the
> > > modules. Something like:
> > >
> > > add_library(CMake::CXX23 IMPORTED INTERFACE)
> > > target_compile_options(CMake::CXX23 PRIVATE -Wno-reserved-module-identifier)
> > > target_sources(CMake::CXX23 INTERFACE FILE_SET TYPE CXX_MODULES FILES std.cppm std.compat.cppm BASE_DIRS …)
> >
> > This information is it intended that libc++ provides that or will that
> > be part of CMake Clang module?
>
> CMake will provide a uniform interface, but a way to extract the needed
> info from the toolchain would be great :) . That is, CMake will concern
> itself with the CMake bits, but metadata from the toolchain about what
> to fill in would be great. MSVC is shipping a `modules.json` file. I'd
> be fine with building on that (i.e., the flag needed to silence warnings
> would be nice to have in there somewhere).

I'm fine with that approach. Does MSVC STL's json file follow any
specification or is it an ad hoc format?

Cheers,
Mark

Received on 2023-07-12 18:36:39