> 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@xs4all.nl>
Sent: Wednesday, July 12, 2023 11:36 AM
To: Ben Boeckel <ben.boeckel@kitware.com>
Cc: Mark de Wever via SG15 <sg15@lists.isocpp.org>; Louis Dionne <ldionne@apple.com>; Casey Carter <casey.carter@microsoft.com>; Aaron Mondal <aaron@eomii.org>; Stephan T. Lavavej <stl@exchange.microsoft.com>; Chuanqi Xu <yedeng.yd@linux.alibaba.com>
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