2

I'm currently working on a project that use CMake but I do not understand the differences between the kits offered.

Within select a kit menu for a project on VSCode there is several options listed on my PC:

  • [Scan for kits] Search for compilers on this computer
  • [Unspecified] Unspecified (Let CMake guess what compilers and enviroment to use)
  • Visual Studio Community 2019 Release - amd64
  • Visual Studio Community 2019 Release - amd64_x86
  • Visual Studio Community 2019 Release - x86
  • Visual Studio Community 2019 Release - x86_amd64
  • Visual Studio Community 2022 Release - amd64 Using compilers for 17.5.0 (x64 architecture)
  • Visual Studio Community 2022 Release - amd64_x86 Using compilers for 17.5.0 (x64_x86 architecture)
  • Visual Studio Community 2022 Release - x86 Using compilers for 17.5.0 (x86 architecture)
  • Visual Studio Community 2022 Release - x86_amd64 Using compilers for 17.5.0 (x86_x64 architecture)

What are the differences between those options?

starball
  • 20,030
  • 7
  • 43
  • 238
Limyx826
  • 37
  • 6
  • Related: [When compiling x64 code, what's the difference between "x86\_amd64" and "amd64"?](https://stackoverflow.com/questions/3508173/when-compiling-x64-code-whats-the-difference-between-x86-amd64-and-amd64) – starball Feb 25 '23 at 07:47
  • Somewhat related on r/linuxquestions: [Difference between x86, x86-64, AMD64 and x64](https://www.reddit.com/r/linuxquestions/comments/ra4vjj/difference_between_x86_x8664_amd64_and_x64/) – starball Feb 25 '23 at 08:01

1 Answers1

2

"Visual Studio Community 2019 Release" and "Visual Studio Community 2022 Release" are versions of Visual Studio, which is a Microsoft IDE. You have those two versions installed on your machine.

x86 is a family of instruction set architectures ("ISAs"). I believe Visual Studio (and VS Code) use "x86" to mean the 32-bit x86 ISA, and "amd64" to mean the 64-bit x86 ISA.

My understanding is that

  • "amd64" means to use a 64-bit compiler toolset to produce binaries for your program targting at 64-bit platform.

  • "amd64_x86" means to use a 64-bit compiler toolset to produce binaries for your program targeting a 32-bit platform.

  • "x86" means to use a 32-bit compiler toolset to produce binaries for your program targeting a 32-bit platform.

  • "x86_amd64" means to use a 32-bit compiler toolset to produce binaries for your program targeting a 64-bit platform.

You can see for yourself the "platform" and "toolset" fields of the "preferredGenerator" field of those scanned-for kits (Use the CMake: Edit User-Local CMake Kits command to view the JSON file where kit definitions are stored). "Toolset" refers to the Visual Studio build tool binaries that are used to produce binaries for your program(s).

Since you're using the cmake-tools extension, related to CMake, you might be interested to know about the CMAKE_VS_PLATFORM_NAME_DEFAULT CMake variable:

Default for the Visual Studio target platform name for the current generator without considering the value of the CMAKE_GENERATOR_PLATFORM variable. For Visual Studio Generators for VS 2017 and below this is always Win32. For VS 2019 and above this is based on the host platform.

See also the CMake docs for its Visual Studio generators, where you can read about the "platform" and "toolchain" generator parameters.

Also slightly related on that note: Why does MSVC defaults to the 32 bit toolset on x64 host machines?

starball
  • 20,030
  • 7
  • 43
  • 238
  • On my PC VSC 2019 has been uninstalled yet I had no idea why that still lingers in my PC. Any recommend thread I should look for to clean up the files? – Limyx826 Feb 26 '23 at 07:42
  • @Limyx826 ask that in a new question post and then ping me in the comments here with a link to it. I know the answer :) – starball Feb 26 '23 at 09:34