From 2d16c7ef06e22cae51436957bb6b80ea350a709f Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 12 Dec 2017 11:00:47 +0200 Subject: Add support for VC 15u5 (compiler version 19.12) --- build2/cc/compile.cxx | 8 +++++--- build2/cc/guess.cxx | 4 +++- build2/cxx/init.cxx | 25 +++++++++++++++++-------- build2/function.hxx | 2 +- build2/test/script/regex.hxx | 6 +++--- 5 files changed, 29 insertions(+), 16 deletions(-) (limited to 'build2') diff --git a/build2/cc/compile.cxx b/build2/cc/compile.cxx index bb0ad37..d73e67c 100644 --- a/build2/cc/compile.cxx +++ b/build2/cc/compile.cxx @@ -2945,11 +2945,13 @@ namespace build2 if (ps) psrc.active = true; // Re-arm. - // VC15 is not (yet) using the 'export module' syntax so use the - // preprequisite type to distinguish between interface and + // Prior to 15u5 VC was not using the 'export module' syntax so we + // use the preprequisite type to distinguish between interface and // implementation units. // - if (cid == compiler_id::msvc && src.is_a (*x_mod)) + if (cid == compiler_id::msvc && + cmaj == 19 && cmin <= 11 && + src.is_a (*x_mod)) { // It's quite painful to guard the export with an #if/#endif so // if it is present, "fixup" the (temporary) preprocessed output diff --git a/build2/cc/guess.cxx b/build2/cc/guess.cxx index df7899b..6dea97d 100644 --- a/build2/cc/guess.cxx +++ b/build2/cc/guess.cxx @@ -1034,6 +1034,7 @@ namespace build2 // // year ver cl.exe crt/dll // + // 2017 15u5 19.12 14.1/140 // 2017 15u3 19.11 14.1/140 // 2017 15 19.10 14.1/140 // 2015 14 19.00 14.0/140 @@ -1044,7 +1045,8 @@ namespace build2 // 2005 8 14.00 8.0/80 // 2003 7.1 13.10 7.1/71 // - /**/ if (v.major == 19 && v.minor == 11) arch += "14.1"; + /**/ if (v.major == 19 && v.minor == 12) arch += "14.1"; + else if (v.major == 19 && v.minor == 11) arch += "14.1"; else if (v.major == 19 && v.minor == 10) arch += "14.1"; else if (v.major == 19 && v.minor == 0) arch += "14.0"; else if (v.major == 18 && v.minor == 0) arch += "12.0"; diff --git a/build2/cxx/init.cxx b/build2/cxx/init.cxx index 5eefa53..c7d6fd9 100644 --- a/build2/cxx/init.cxx +++ b/build2/cxx/init.cxx @@ -151,11 +151,16 @@ namespace build2 // While modules are supported in VC15u0 (19.10), there is a // bug in separate interface/implementation unit support which // makes them pretty much unusable. This has been fixed in - // VC15u3 (19.11) + // VC15u3 (19.11). And VC15u5 supports the 'export module M;' + // syntax. // if (mj > 19 || (mj == 19 && mi >= (l ? 10 : 11))) { - r.push_back ("/D__cpp_modules=201703"); // n4647 + r.push_back ( + mj > 19 || mi > 11 + ? "/D__cpp_modules=201704" // p0629r0 (export module M;) + : "/D__cpp_modules=201703"); // n4647 ( module M;) + r.push_back ("/experimental:module"); modules = true; } @@ -209,7 +214,8 @@ namespace build2 { // C++ standard-wise, with VC you got what you got up until 14u2. // Starting with 14u3 there is now the /std: switch which defaults - // to c++14 but can be set to c++latest. + // to c++14 but can be set to c++latest. And from 15u3 it can be + // c++17. // // The question is also whether we should verify that the // requested standard is provided by this VC version. And if so, @@ -248,12 +254,15 @@ namespace build2 info << "required by " << project (rs) << '@' << rs.out_path (); - // VC14u3 and later has /std: - // - if (mj > 19 || (mj == 19 && (mi > 0 || (mi == 0 && p >= 24215)))) + if (mj > 19 || (mj == 19 && mi >= 11)) // 15u3 + { + if (*v == "14") r.push_back ("/std:c++14"); + else if (*v == "17") r.push_back ("/std:c++17"); + } + else if (mj == 19 && (mi > 0 || (mi == 0 && p >= 24215))) // 14u3 { - if (*v == "17") - r.push_back ("/std:c++latest"); + if (*v == "14") r.push_back ("/std:c++14"); + else if (*v == "17") r.push_back ("/std:c++latest"); } } break; diff --git a/build2/function.hxx b/build2/function.hxx index 96bf401..7507bec 100644 --- a/build2/function.hxx +++ b/build2/function.hxx @@ -124,7 +124,7 @@ namespace build2 // std::is_pod appears to be broken in VC15 and also in GCC up to // 5 (pointers to members). // -#if !((defined(_MSC_VER) && _MSC_VER <= 1911) || \ +#if !((defined(_MSC_VER) && _MSC_VER <= 1912) || \ (defined(__GNUC__) && !defined(__clang__) && __GNUC__ <= 5)) static_assert (std::is_pod::value, "type is not POD"); #endif diff --git a/build2/test/script/regex.hxx b/build2/test/script/regex.hxx index 696fb2a..c8c3877 100644 --- a/build2/test/script/regex.hxx +++ b/build2/test/script/regex.hxx @@ -424,7 +424,7 @@ namespace std // template <> class ctype: public ctype_base -#if !defined(_MSC_VER) || _MSC_VER > 1911 +#if !defined(_MSC_VER) || _MSC_VER > 1912 , public locale::facet #endif { @@ -437,7 +437,7 @@ namespace std static locale::id id; -#if !defined(_MSC_VER) || _MSC_VER > 1911 +#if !defined(_MSC_VER) || _MSC_VER > 1912 explicit ctype (size_t refs = 0): locale::facet (refs) {} #else @@ -519,7 +519,7 @@ namespace std // Workaround for msvcrt bugs. For some reason it assumes such a members // to be present in a regex_traits specialization. // -#if defined(_MSC_VER) && _MSC_VER <= 1911 +#if defined(_MSC_VER) && _MSC_VER <= 1912 static const ctype_base::mask _Ch_upper = ctype_base::upper; static const ctype_base::mask _Ch_alpha = ctype_base::alpha; -- cgit v1.1