Lexi Winter <ivy_at_FreeBSD.org> wrote on Date: Sun, 06 Jul 2025 21:02:58 UTC :
> The branch main has been updated by ivy: > > URL: > https://cgit.FreeBSD.org/src/commit/?id=d3c06bed2c16b434dd49958dee5de8c55ad00b85 > > commit d3c06bed2c16b434dd49958dee5de8c55ad00b85 > Author: Lexi Winter <i...@freebsd.org> > AuthorDate: 2025-07-06 20:42:58 +0000 > Commit: Lexi Winter <i...@freebsd.org> > CommitDate: 2025-07-06 21:02:52 +0000 > > clang: install clang-scan-deps > > clang-scan-deps is used to generate dependency information from C++20 > modules according to proposed standard ISO/IEC WG21 P1689R5[0]. It is > required by common build tools (e.g., CMake) to build C++ sources > that use modules. > > Since this is a core build tool, install it by default, not gated > behind MK_CLANG_EXTRAS. > > [0] https://www.open-std.org/JTC1/SC22/WG21/docs/papers/2022/p1689r5.html > > MFC after: 3 days > Reviewed by: kevans, dim > Approved by: kevans (mentor) > Requested by: jbo > Differential Revision: https://reviews.freebsd.org/D51044 Would it be reasonable to also enable generation/installation of, say (picking one example set of placements for illustration): /usr/lib/libc++.module.json (a guess about where it goes) /usr/include/c++/v1/std.cppm /usr/include/c++/v1/v1/std.compat.cppm to enable use of "import std;" and "import std.compat;" in c++23 baesd projects (and clang's c++20 as it turns out)? There likely would also be: /usr/include/c++/v1/std/*.inc /usr/include/c++/v1/v1/std.compat/*.inc An alternate might set of placements might be: /usr/lib/libc++.module.json /usr/share/libc++/v1/std.cppm /usr/share/libc++/v1/std.compat.cppm /usr/share/libc++/v1/std/*.inc /usr/share/libc++/v1/v1/std.compat/*.inc Both styles would allow for alternate paths involving, say something like: /usr/local/llvm20/lib/libc++.module.json /usr/local/llvm20/include/c++/v1/std* vs.: /usr/local/share/llvm20/libc++/v1/std* (where the * may expand to more path components). Precompiling, say, a std module with the compiler options matching a project could look like: # clang++ -std=c++23 -precompile -o std.pcm \ /usr/local/llvm20/include/c++/v1/std.cppm vs. # clang++ -std=c++23 -precompile -o std.pcm \ /usr/local/share/llvm20/libc++/v1/std.cppm then, say: # clang++ -O3 -std=c++23 -fmodule-file=std.pcm -o teststd teststd.cpp (My understanding is that clang++ 19.1.7 fixed the problem it previously had with finding libc++.module.json when it is part of the installed materials. But I'm not familiar with the details.) === Mark Millard marklmi at yahoo.com