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

Make sure "toolset" keyword is generated for all the VS generators that support it #1981

Open
andreeis opened this issue Jul 7, 2021 · 3 comments
Labels
bug a bug in the product Feature: kits help wanted we currently are not planning work on this and would like help from the open source community
Milestone

Comments

@andreeis
Copy link
Contributor

andreeis commented Jul 7, 2021

@andreeis I am experiencing the same issue with visual studio code 1.57.1 and the CMake Tools extension's version 1.7.3. I see your fix in the release notes. Therefore there is certainly something I am doing wrong. Here's my cmake-tools-kits.json:

[
  {
    "name": "GCC 9.2.0",
    "compilers": {
      "C": "C:\\MinGW\\bin\\gcc.exe",
      "CXX": "C:\\MinGW\\bin\\g++.exe"
    },
    "preferredGenerator": {
      "name": "MinGW Makefiles"
    },
    "environmentVariables": {
      "CMT_MINGW_PATH": "C:\\MinGW\\bin"
    }
  },
  {
    "name": "GCC 9.2.0 mingw32",
    "compilers": {
      "C": "C:\\MinGW\\bin\\mingw32-gcc.exe",
      "CXX": "C:\\MinGW\\bin\\mingw32-g++.exe"
    },
    "preferredGenerator": {
      "name": "MinGW Makefiles"
    },
    "environmentVariables": {
      "CMT_MINGW_PATH": "C:\\MinGW\\bin"
    }
  },
  {
    "name": "GCC for mingw32 9.2.0",
    "compilers": {
      "C": "C:\\MinGW\\bin\\mingw32-gcc.exe",
      "CXX": "C:\\MinGW\\bin\\mingw32-g++.exe"
    },
    "preferredGenerator": {
      "name": "MinGW Makefiles"
    },
    "environmentVariables": {
      "CMT_MINGW_PATH": "C:\\MinGW\\bin"
    }
  },
  {
    "name": "Visual Studio Professional 2019 Release - amd64",
    "visualStudio": "33a40df0",
    "visualStudioArchitecture": "x64",
    "preferredGenerator": {
      "name": "Visual Studio 16 2019",
      "platform": "x64",
      "toolset": "host=x64"
    }
  },
  {
    "name": "Visual Studio Professional 2019 Release - amd64_x86",
    "visualStudio": "33a40df0",
    "visualStudioArchitecture": "x64",
    "preferredGenerator": {
      "name": "Visual Studio 16 2019",
      "platform": "win32",
      "toolset": "host=x64"
    }
  },
  {
    "name": "Visual Studio Professional 2019 Release - x86",
    "visualStudio": "33a40df0",
    "visualStudioArchitecture": "x86",
    "preferredGenerator": {
      "name": "Visual Studio 16 2019",
      "platform": "win32",
      "toolset": "host=x86"
    }
  },
  {
    "name": "Visual Studio Professional 2019 Release - x86_amd64",
    "visualStudio": "33a40df0",
    "visualStudioArchitecture": "x86",
    "preferredGenerator": {
      "name": "Visual Studio 16 2019",
      "platform": "x64",
      "toolset": "host=x86"
    }
  },
  {
    "name": "VisualStudio.10.0 - amd64",
    "visualStudio": "VisualStudio.10.0",
    "visualStudioArchitecture": "x64",
    "preferredGenerator": {
      "name": "Visual Studio 10 2010",
      "platform": "x64"
    }
  },
  {
    "name": "VisualStudio.10.0 - x86",
    "visualStudio": "VisualStudio.10.0",
    "visualStudioArchitecture": "x86",
    "preferredGenerator": {
      "name": "Visual Studio 10 2010",
      "platform": "win32"
    }
  },
  {
    "name": "VisualStudio.10.0 - x86_amd64",
    "visualStudio": "VisualStudio.10.0",
    "visualStudioArchitecture": "x86",
    "preferredGenerator": {
      "name": "Visual Studio 10 2010",
      "platform": "x64"
    }
  }
]

That is what I get after a CMake: Scan for kits. How do make the toolset appear for my visual studio 2010 kits or how do I prevent visual studio code from adding the options -T host=x64 -A x64 to the cmake command?

Originally posted by @zadigus in #1352 (comment)

@andreeis andreeis added bug a bug in the product Feature: kits help wanted we currently are not planning work on this and would like help from the open source community labels Jul 7, 2021
@andreeis
Copy link
Contributor Author

andreeis commented Jul 7, 2021

If anyone is willing to test a simple VS version number change we would be interested in accepting a PR.
In kit.ts, function tryCreateNewVCEnvironment, majorVersion may need to be 14 instead of 15.

According to CMake toolset keyword documentation, "toolset" should be supported starting with VS 2010.

@andreeis andreeis added this to the Backlog milestone Oct 11, 2021
@Tarisper
Copy link

Tarisper commented Nov 25, 2021

If anyone is willing to test a simple VS version number change we would be interested in accepting a PR. In kit.ts, function tryCreateNewVCEnvironment, majorVersion may need to be 14 instead of 15.

According to CMake toolset keyword documentation, "toolset" should be supported starting with VS 2010.

I have the same problem. Are there any plans to fix it? I'm ready to test the changes.

@chausner
Copy link
Contributor

In kit.ts, function tryCreateNewVCEnvironment, majorVersion may need to be 14 instead of 15.
According to CMake toolset keyword documentation, "toolset" should be supported starting with VS 2010.

VS 2010 corresponds to version 10 according to the version table on Wikipedia. So shouldn't this be changed to 10 then?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug a bug in the product Feature: kits help wanted we currently are not planning work on this and would like help from the open source community
Projects
Status: Pending Prioritization
Development

No branches or pull requests

3 participants