File tree 2 files changed +25
-0
lines changed
2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -406,6 +406,7 @@ const char *ms_cl_prefixes[]=
406
406
" MT" , // link with LIBCMT.LIB
407
407
" MDd" , // link with MSVCRTD.LIB debug lib
408
408
" MTd" , // link with LIBCMTD.LIB debug lib
409
+ " std" , // specify C++ language standard
409
410
nullptr
410
411
};
411
412
Original file line number Diff line number Diff line change @@ -77,6 +77,30 @@ int ms_cl_modet::doit()
77
77
else
78
78
compiler.mode =compilet::COMPILE_LINK_EXECUTABLE;
79
79
80
+ if (cmdline.isset (" std" ))
81
+ {
82
+ const std::string std_string = cmdline.get_value (" std" );
83
+
84
+ if (
85
+ std_string == " :c++14" || std_string == " =c++14" ||
86
+ std_string == " :c++17" || std_string == " =c++17" ||
87
+ std_string == " :c++latest" || std_string == " =c++latest" )
88
+ {
89
+ // we don't have any newer version at the moment
90
+ config.cpp .set_cpp14 ();
91
+ }
92
+ else if (std_string == " :c++11" || std_string == " =c++11" )
93
+ {
94
+ // this isn't really a Visual Studio variant, we just do this for GCC
95
+ // command-line compatibility
96
+ config.cpp .set_cpp11 ();
97
+ }
98
+ else
99
+ warning () << " unknown language standard " << std_string << eom;
100
+ }
101
+ else
102
+ config.cpp .set_cpp14 ();
103
+
80
104
compiler.echo_file_name =true ;
81
105
82
106
if (cmdline.isset (" Fo" ))
You can’t perform that action at this time.
0 commit comments