Open Timmmm opened 7 years ago
Yes, this is a known missing feature. We can do three things here which are reasonable:
Maintain a mapping between VC++ version and the stds they support
If the requested std is older than c++14, validate against the mapping and error out if the compiler version is too old. If it's new enough, no new args will be added.
If the requested std is c++14 (or newer in the future) and the compiler version is new enough, add -std:c++14
. If the compiler version is too old for the option but new enough for c++14, do nothing. If the compiler version is too old for c++14, error out.
However, it's not clear what the advantage is over just ignoring the cpp_std
value right now. It looks like -std:c++14
doesn't actually do anything yet. It just reflects the current state of the compiler. In fact, it reflects the current state rather poorly. Even in VS 2017.
I think we should wait and see if Microsoft actually ever releases a C++ compiler that can be run in standards-compliant mode.
I implemented support for this in https://github.com/mesonbuild/meson/pull/2836
As far as I can tell,
cpp_std
does nothing with MSVC. It's also not clear what it should do if you specifygnu...
versions, e.g.gnu++11
. I suggest it should treat those as if they werec++11
, otherwise there's no way to getgnu++14
with GCC, andc++14
with MSVC.These are the available options. As of now it is just
/std:c++14
and/std:c++latest
. Probably not worth supportingc++latest
.