Skip to content

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

@slymz

Description

@slymz

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions