From c17323cb691abadf54487993407f862a1a6298bc Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 11 Apr 2019 20:03:25 +0200 Subject: Only enable MSVC /permissive- in experimental mode Currently this flag tends to trigger too many compiler bugs. --- build2/cxx/init.cxx | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'build2') diff --git a/build2/cxx/init.cxx b/build2/cxx/init.cxx index d32012c..aca1fb8 100644 --- a/build2/cxx/init.cxx +++ b/build2/cxx/init.cxx @@ -146,12 +146,6 @@ namespace build2 if (!o.empty ()) r.push_back (move (o)); - // Starting with 15.5 (19.12) Visual Studio-created projects default - // to the strict mode. - // - if (mj > 19 || (mj == 19 && mi >= 12)) - r.push_back ("/permissive-"); - break; } case compiler_class::gcc: @@ -247,6 +241,24 @@ namespace build2 if (experimental) { + switch (ct) + { + case compiler_type::msvc: + { + // Starting with 15.5 (19.12) Visual Studio-created projects + // default to the strict mode. However, this flag currently tends + // to trigger too many compiler bugs. So for now we leave it + // to the experimenters to enjoy. + // + if (mj > 19 || (mj == 19 && mi >= 12)) + r.push_back ("/permissive-"); + + break; + } + default: + break; + } + // Unless disabled by the user, try to enable C++ modules. Here we use // a tri-state: // -- cgit v1.1