Skip to content
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

fix meson cpp_std for VS2019 and 2022 c++20. #13450

Merged

Conversation

lukester1975
Copy link
Contributor

@lukester1975 lukester1975 commented Mar 15, 2023

Changelog: Fix: Generate cpp_std=vc++20 for c++20 with meson with VS2019 and VS2022, rather than vc++latest.
Docs: Omit

Fixes #13424

Note meson 1.0.1 is required for it (meson) to accept vc++20 with clang-cl.

Given the comment about _msvc_supported_cppstd in the issue, I've made a slight change from the version there. It looks like _msvc_supported_cppstd reports VS2019 as only supporting up to c++20, so I've kept c++23 as VS2022 only in this version.

Thanks

@CLAassistant
Copy link

CLAassistant commented Mar 15, 2023

CLA assistant check
All committers have signed the CLA.

Copy link
Member

@memsharded memsharded left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI failed, but I think it is related to the comment.

If you can try to run the tests locally, it is:

pytest conans/test/unittests/client/build/cpp_std_flags_test.py::CompilerFlagsTest::test_visual_cppstd_flags -s

return {"14": v14, "17": v17, "20": v20, "23": v23}.get(str(cppstd), None)

def _cppstd_msvc(visual_version, cppstd):
flag = cppstd_msvc_flag(visual_version, cppstd).get(str(cppstd), None)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems this is redundant?

Suggested change
flag = cppstd_msvc_flag(visual_version, cppstd).get(str(cppstd), None)
flag = cppstd_msvc_flag(visual_version, cppstd)

@lukester1975 lukester1975 force-pushed the feature/fix-meson-cppstd20 branch 2 times, most recently from fe43a15 to 3bbf28c Compare March 15, 2023 20:51
Note meson 1.0.1 is required for it to accept c++20 with clang-cl.
@lukester1975 lukester1975 force-pushed the feature/fix-meson-cppstd20 branch from 3bbf28c to e1df479 Compare March 15, 2023 21:18
@memsharded memsharded added this to the 2.0.3 milestone Mar 15, 2023
@lukester1975
Copy link
Contributor Author

Sorry yeah that first attempt was nonsense... Hopefully good now.

Copy link
Member

@memsharded memsharded left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks very much for contributing this, merging it for next 2.0.3

@memsharded memsharded merged commit 427dc7a into conan-io:release/2.0 Mar 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[feature] can't specify c++20 with meson generator
3 participants