[libcxx-commits] [PATCH] D144994: [Draft][libc++][modules] Adds std module.
Chuanqi Xu via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Sun Mar 12 19:13:10 PDT 2023
ChuanqiXu added a subscriber: ruoso.
ChuanqiXu added inline comments.
================
Comment at: libcxx/docs/Modules.rst:65
+ to discuss that approach before spending effort in it.
+ * Currently the ``cppm`` file and the generated ``CMakeLists.txt`` are not
+ installed. Before doing that it would be good to determine what the best
----------------
h-vetinari wrote:
> Mordante wrote:
> > aaronmondal wrote:
> > > We intend to distribute all `.cppm` files, i.e. the partitions as well, right?
> > Yes I want to distribute them, in fact we must distribute them else users can't use modules.
> >
> > But we need to find the "proper" location to store them. Since this is something new this probably needs some involvement of our packagers. I don't expect the Linux Standard Base has an entry for C++20 modules.
> > But we need to find the "proper" location to store them. Since this is something new this probably needs some involvement of our packagers. I don't expect the Linux Standard Base has an entry for C++20 modules.
>
> As mentioned already, I think there are strong parallels with distributing headers. The bare minimum should be that they are automatically discoverable by the toolchain that produced them (should be somewhere under INSTALL_PREFIX obviously), but ideally it's in a standard location that's uniform across toolchains (again, relative to a PREFIX), like the headers and libs are too. I'm not sure if SG21 has had discussions about this, or if CMake has already thought about this.
>
> Personally, I think the best might be a separate folder like `$PREFIX/something_module_related/foo.cppm`, but I wouldn't care much or at all if it's under `$PREFIX/include/something_module_related/foo.cppm` or `$PREFIX/lib/<libname>/foo.cppm`, etc., as long as it's discoverable and works.
>
> CC @mgorny as another packager & @ben.boeckel for the CMake side.
> I'm not sure if SG21 has had discussions about this, or if CMake has already thought about this.
As far as I know, sg15 has discussed this for a long time. (If I recall this correctly,) sg15 don't get the final consensus yet. But @ruoso has already made a lot of proposals. We can look at them later.
> Personally, I think the best might be a separate folder like $PREFIX/something_module_related/foo.cppm, but I wouldn't care much or at all if it's under $PREFIX/include/something_module_related/foo.cppm or $PREFIX/lib/<libname>/foo.cppm, etc., as long as it's discoverable and works.
I think we need to discuss this in the discourse. Because the patch is going to be a large patch and the topic about distribution is another big topic. It looks not good to discuss two big things in the same page. The direction may be lost.
================
Comment at: libcxx/stdmodules/std-compat.cppm:1
+# 1 __FILE__ 1 3
+// -*- C++ -*-
----------------
`std.compat.cppm` may be a better name. Since `std-compat.cppm` looks like a partition of the std module to me.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D144994/new/
https://reviews.llvm.org/D144994
More information about the libcxx-commits
mailing list