-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add cpp_std support for MSVC #4390
Conversation
@@ -1,8 +1,8 @@ | |||
project('msvc_cpp17', 'cpp', default_options: ['cpp_std=c++17']) | |||
|
|||
if meson.get_compiler('cpp').version().version_compare('<19.11') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you need to check that the compiler is msvc before checking the version, this could be gcc, clang, icc, or a host of other compilers.
Also, please squash this back into the previous patch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will do, I planned to make sure it worked first.
The problem we are going to face with this is that there are existing projects that default to, say, In this case We could make it error out if using a value not supported by the current compiler. This is a bit inconvenient but it is easily fixed by giving an explicit |
Hmm. Alternatively, you could deprecate
and alternatively,
and |
Having more than one toggle switch for this is not really a nice UI. The dialect names have very specific meanings and people are used to them and want to use them directly. The important design decisions here seem to include:
|
@jpakkane fair. I think it's reasonable to not support |
I agree that we shouldn't try to map compiler extensions unless they're actually compatible. Mapping gnu++14 to c++14 or vs++14 is just going to lead to compilation failures without warning that will confuse people. It would be better to make it a hard error. Especially since anyone writing C or C++ should know that gnu standards are not portable. |
Interestingly the CI failure is exactly because of this issue (the Travis one is spurious):
One of the configurations in the test matrix is VS 2015. According to the code it should add C++14 but apparently does not. But at least we know that trying to use an incorrect value causes a hard error. |
I apparently used the wrong version numbers. I've changed it to a test for Also, I do have the code for |
Let's do this first. Smaller changes are better. |
cool! |
As of right now, we have to use this silly hack https://github.com/ubsan/ublib/blob/master/meson.build#L17, so I decided to add C++17 support.
Mostly based on #2836