From 4a47a60f958339d5ccf479481b0d4e998ee0d448 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 21 Feb 2020 08:37:10 +0200 Subject: Define __cpp_modules=201810 (merged modules) for MSVC 16.4 --- libbuild2/cxx/init.cxx | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'libbuild2/cxx') diff --git a/libbuild2/cxx/init.cxx b/libbuild2/cxx/init.cxx index 901fd8f..a886cbc 100644 --- a/libbuild2/cxx/init.cxx +++ b/libbuild2/cxx/init.cxx @@ -273,18 +273,21 @@ namespace build2 { case compiler_type::msvc: { - // While modules are supported in VC15.0 (19.10), there is a bug - // in separate interface/implementation unit support which makes - // them pretty much unusable. This has been fixed in VC15.3 - // (19.11). And VC15.5 (19.12) supports the 'export module M;' - // syntax. + // While modules are supported in VC 15.0 (19.10), there is a + // bug in the separate interface/implementation unit support + // which makes them pretty much unusable. This has been fixed in + // 15.3 (19.11). And 15.5 (19.12) supports the `export module + // M;` syntax. And 16.4 (19.24) supports the global module + // fragment. // if (mj > 19 || (mj == 19 && mi >= (l ? 10 : 12))) { r.push_back ( - mj > 19 || mi > 11 - ? "/D__cpp_modules=201704" // p0629r0 (export module M;) - : "/D__cpp_modules=201703"); // n4647 ( module M;) + mj > 19 || mi >= 24 ? + "/D__cpp_modules=201810" : // p1103 (merged modules) + mj == 19 || mi >= 12 ? + "/D__cpp_modules=201704" : // p0629r0 (export module M;) + "/D__cpp_modules=201703"); // n4647 ( module M;) r.push_back ("/experimental:module"); modules = true; -- cgit v1.1