C++ Logo

sg15

Advanced search

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

From: Stephan T. Lavavej <stl_at_[hidden]>
Date: Wed, 12 Jul 2023 19:26:29 +0000
> Does MSVC STL's json file follow any specification or is it an ad hoc format?

The specification was "what Olga told me she wanted for the IDE/MSBuild" so I suppose it's ad hoc. (It is versioned, though.)

STL

________________________________
From: Mark de Wever <koraq_at_[hidden]>
Sent: Wednesday, July 12, 2023 11:36 AM
To: Ben Boeckel <ben.boeckel_at_[hidden]>
Cc: Mark de Wever via SG15 <sg15_at_[hidden]>; Louis Dionne <ldionne_at_[hidden]>; Casey Carter <casey.carter_at_[hidden]>; Aaron Mondal <aaron_at_[hidden]>; Stephan T. Lavavej <stl_at_[hidden]>; Chuanqi Xu <yedeng.yd_at_[hidden]>
Subject: Re: [SG15] Provide build systems with ways to build the std(.compat) modules

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 19:26:34