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

[Meson][Windows] detect MSVC usage #941

Merged
merged 1 commit into from
Dec 12, 2024
Merged

Conversation

UnixY2K
Copy link
Contributor

@UnixY2K UnixY2K commented Dec 12, 2024

previous check tested for compiler ID in meson, detection of an specific MSVC macro is preferred so it works in any compiler that includes the MSVC stdlib.

I noticed this error while trying to compile the 0.11.0 version

  • changes the compiler check to macro check _MSC_VER which is an Microsoft specific macro
  • changes the current defined version to 0.11.1, previous was 0.11.0

@UnixY2K UnixY2K changed the title [Meson] detect MSVC usage [Meson|Windows] detect MSVC usage Dec 12, 2024
@UnixY2K UnixY2K changed the title [Meson|Windows] detect MSVC usage [Meson][Windows] detect MSVC usage Dec 12, 2024
@wolfpld
Copy link
Owner

wolfpld commented Dec 12, 2024

Wouldn't it be better to just remove that whole condition and add a default_options: ['cpp_std=c++11'] parameter to the project definition?

previous check tested for compiler ID, fixed the detection to an specific MSVC macro and the current C++ version so it does not override an user specified version
@UnixY2K
Copy link
Contributor Author

UnixY2K commented Dec 12, 2024

Wouldn't it be better to just remove that whole condition and add a default_options: ['cpp_std=c++11'] parameter to the project definition?

the issue is that MSVC stdlib is not fully C++11 compliant, so compilation will fail in Windows unless C++14 is used.

I set the std by default to C++11 and increased the meson version as I noticed some warnings with the new macro check, any other platform will just use C++11 by default.

@wolfpld wolfpld merged commit 87c54f9 into wolfpld:master Dec 12, 2024
6 checks passed
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.

2 participants