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

support MSVC toolset option for side-by-side toolset installations #27

Open
slymz opened this issue Nov 4, 2021 · 1 comment
Open
Labels
bug Something isn't working

Comments

@slymz
Copy link

slymz commented Nov 4, 2021

Struct Layout compilation uses incorrect version of MSVC++ toolchain when the system has multiple VS installations, and/or multiple toolchain installed side-by-side on a single VS instance, and a given project is configured to select a specific version.

Here is the project configuration snapshot where this setting is made:

image

To reproduce, install a secondary (older) version of C++ toolchain using the VS Installer (locate one under individual component install). Configure a sample project to use this older version. Struct Layout will insist on using the latest version available, instead of the one specified by the project.

On non-trivial codes, this causes compiler errors because the code may not be compatible with the new toolchain versions (hence the official support for such per-project selection and side-by-side paradigm by VS). To reproduce this scenario artificially, add the following preprocessor condition in code:

For example,

#if _MSC_VER > 1927
#error "unsupported compiler
#endif

where 19.27 corresponds to v14.27 of the MSVC toolchain:

image

@slymz slymz changed the title support MSVC toolset option for side-by-side toolchain installations support MSVC toolset option for side-by-side toolset installations Nov 4, 2021
@Viladoman Viladoman added the bug Something isn't working label Nov 9, 2021
@Viladoman Viladoman added this to Open in Configurations Nov 9, 2021
@Viladoman
Copy link
Owner

Thanks for reporting this. The Struct Layout parser is using Clang underneath, but I will have a look to see if I can at least propagate the proper version definitions.

Hopefully I will have time to have a look soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Development

No branches or pull requests

2 participants