aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/cc/compile-rule.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2024-05-13 13:38:11 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2024-05-13 13:38:11 +0200
commite12b3766726e6b9f8f204504c52faffa551d2375 (patch)
treef6637713b3d73b17fee3809d2ed71841b40f9a5c /libbuild2/cc/compile-rule.cxx
parentd016d59957a74d42be81336e96b8b96d5bc0b3a1 (diff)
Update std.cppm to Clang 18, add std.compat.cppm
Note that Clang 17 is not longer supported with regards to standard library modules.
Diffstat (limited to 'libbuild2/cc/compile-rule.cxx')
-rw-r--r--libbuild2/cc/compile-rule.cxx31
1 files changed, 14 insertions, 17 deletions
diff --git a/libbuild2/cc/compile-rule.cxx b/libbuild2/cc/compile-rule.cxx
index 2e4775e..1548395 100644
--- a/libbuild2/cc/compile-rule.cxx
+++ b/libbuild2/cc/compile-rule.cxx
@@ -6157,7 +6157,7 @@ namespace build2
//
if ((ctype == compiler_type::msvc) ||
(ctype == compiler_type::clang &&
- cmaj >= 17 &&
+ cmaj >= 18 &&
cast<string> (rs[x_stdlib]) == "libc++"))
{
// Similar logic to check_exact() above.
@@ -6177,10 +6177,7 @@ namespace build2
{
case compiler_type::clang:
{
- if (m.name != "std")
- fail << "module " << m.name << " not yet provided by libc++";
-
- // Find or insert std.cppm (similar code to pkgconfig.cxx).
+ // Find or insert std*.cppm (similar code to pkgconfig.cxx).
//
// Note: build_install_data is absolute and normalized.
//
@@ -6188,7 +6185,7 @@ namespace build2
*x_mod,
(dir_path (build_install_data) /= "libbuild2") /= "cc",
dir_path (),
- "std",
+ m.name,
string ("cppm"), // For C++14 during bootstrap.
target_decl::implied,
trace).first;
@@ -6199,18 +6196,18 @@ namespace build2
// type. And we could do that by looking for -static-libstdc++
// in loption (and no, it's not -static-libc++).
//
- // But, looking at the object file produced from std.cppm, it
- // only contains one symbol, the static object initializer.
- // And this is unlikely to change since all other non-inline
- // or template symbols should be in libc++. So feels like it's
- // not worth the trouble and one variant should be good enough
- // for both cases. Let's use the shared one for less
- // surprising diagnostics (as in, "why are you linking obje{}
- // to a shared library?")
+ // But, looking at the object file produced from std*.cppm,
+ // they only contain one symbol, the static object
+ // initializer. And this is unlikely to change since all
+ // other non-inline or template symbols should be in
+ // libc++. So feels like it's not worth the trouble and one
+ // variant should be good enough for both cases. Let's use the
+ // shared one for less surprising diagnostics (as in, "why are
+ // you linking obje{} to a shared library?")
//
- // (Of course, theoretically, std.cppm could detect via a
- // macro whether it's being compiled with -fPIC or not and do
- // things differently, but this seems far-fetched).
+ // (Of course, theoretically, std*.cppm could detect via a
+ // macro whether they are being compiled with -fPIC or not and
+ // do things differently, but this seems far-fetched).
//
ot = otype::s;