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

Wrong compiler platform selected with Visual Studio 16 2019 kit #964

Closed
johannesstricker opened this issue Dec 9, 2019 · 6 comments
Closed
Assignees
Milestone

Comments

@johannesstricker
Copy link

Brief Issue Summary

The automatically detected kit for Visual Studio 16 2019 for the x86 platform incorrectly uses the x64 compiler. This can be fixed by adding "platform": "Win32" to the kit configuration in cmake-tools-kits.json and changing "visualStudioArchitecture" from "x86" to "Win32".

Expected:

  1. Scan for kits
  2. Select the Visual Studio 16 2019 - x86 kit
  3. Configure and build
  4. Should generate and build with the x86 compiler.

Apparent Behavior:

  1. The compiler that's being used is the x64 compiler.

Fix:

Open the cmake-tools-kits.json and change

  {
    "name": "Visual Studio Enterprise 2019 Release - x86",
    "visualStudio": "11e6a10a",
    "visualStudioArchitecture": "x86",
    "preferredGenerator": {
      "name": "Visual Studio 16 2019"
    }
  }

to

  {
    "name": "Visual Studio Enterprise 2019 Release - x86",
    "visualStudio": "11e6a10a",
    "visualStudioArchitecture": "Win32",
    "preferredGenerator": {
      "name": "Visual Studio 16 2019",
      "platform": "Win32"
    }
  }

Platform and Versions

  • Operating System: Windows 10
  • CMake Version: 3.16
  • VSCode Version: 1.40.2
  • CMake Tools Extension Version: 1.2.3
  • Compiler/Toolchain: Visual C++ 2019 Enterprise
@H-G-Hristov
Copy link

H-G-Hristov commented Dec 12, 2019

Are you sure about the line: "visualStudioArchitecture": "x86", -> "visualStudioArchitecture": "Win32",.
I'll see what I can do about that issue later.

@Zingam
Copy link
Contributor

Zingam commented Dec 14, 2019

@johannesstricker Could you, please, provide the Debug Console output and your Generator settings.

@andreeis
Copy link
Contributor

I am not reproducing. Can you attach a standalone repro?

@andreeis andreeis added the more info needed More info is needed from the community for us to properly triage and investigate. label Jan 24, 2020
@bobbrow
Copy link
Member

bobbrow commented Jan 24, 2020

@andreeis I don't think it will repro with Ninja, but it should with the Visual Studio generator. @johannesstricker, using Ninja as your generator might also be a workaround.

@bobbrow bobbrow added this to the 1.4.0 milestone Jan 24, 2020
@andreeis andreeis removed the more info needed More info is needed from the community for us to properly triage and investigate. label Jan 29, 2020
@andreeis
Copy link
Contributor

CMake Tools 1.4.0 Beta is available on GitHub.
https://github.com/microsoft/vscode-cmake-tools/releases/tag/1.4.0-beta

Please try it out and let us know if you encounter any issues.

@andreeis
Copy link
Contributor

This fix is available in CMake Tools #1.4.0 which has been released.

@github-actions github-actions bot locked and limited conversation to collaborators Jan 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants