aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2019-04-11 20:03:25 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2019-04-11 20:03:25 +0200
commitc17323cb691abadf54487993407f862a1a6298bc (patch)
tree4b566813a5937991b24a52ca87aad8ccd1f7c5da
parentcb8ac8e4b8c1fd9684f43fa5916f73d494ed817f (diff)
Only enable MSVC /permissive- in experimental mode
Currently this flag tends to trigger too many compiler bugs.
-rw-r--r--build2/cxx/init.cxx24
1 files changed, 18 insertions, 6 deletions
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:
//