【问题标题】:What are the differences between the scanned-for kits on my Windows machine using the VS Code cmake-tools extension?使用 VS Code cmake-tools 扩展在我的 Windows 机器上扫描的工具包之间有什么区别?
【发布时间】:2023-02-25 16:07:14
【问题描述】:

我目前正在从事一个使用 CMake 的项目,但我不了解所提供的工具包之间的差异。

在为 VSCode 上的项目选择工具包菜单中,我的电脑上列出了几个选项:

  • [扫描工具包] 在此计算机上搜索编译器
  • [Unspecified] 未指定(让 CMake 猜测使用什么编译器和环境)
  • Visual Studio 社区 2019 版 - amd64
  • Visual Studio 社区 2019 版 - amd64_x86
  • Visual Studio 社区 2019 版 - x86
  • Visual Studio 社区 2019 版 - x86_amd64
  • Visual Studio Community 2022 版 - amd64 使用适用于 17.5.0(x64 架构)的编译器
  • Visual Studio Community 2022 版 - amd64_x86 使用适用于 17.5.0 的编译器(x64_x86 架构)
  • Visual Studio Community 2022 版 - x86 使用适用于 17.5.0 的编译器(x86 架构)
  • Visual Studio Community 2022 版 - x86_amd64 使用适用于 17.5.0 的编译器(x86_x64 架构)

这些选项之间有什么区别?

【问题讨论】:

标签: visual-studio-code cmake


【解决方案1】:

“Visual Studio Community 2019 Release”和“Visual Studio Community 2022 Release”是Visual Studio, which is a Microsoft IDE的版本。您的机器上安装了这两个版本。

x86 is a family of instruction set architectures ("ISAs")。我相信 Visual Studio 使用“x86”来表示 32 位 ISA,使用“amd64”来表示 64 位 ISA。

我的理解是

  • “amd64”意味着使用 64 位编译器工具集为您的程序在 64 位平台上生成二进制文件。

  • “amd64_x86”表示使用 64 位编译器工具集为面向 32 位平台的程序生成二进制文件。

  • “x86”意味着使用 32 位编译器工具集为您的程序生成二进制文件,目标是 32 位平台。

  • “x86_amd64”表示使用 32 位编译器工具集为面向 64 位平台的程序生成二进制文件。

由于您正在使用与 CMake 相关的 cmake-tools 扩展,您可能有兴趣了解the CMAKE_VS_PLATFORM_NAME_DEFAULT CMake variable

当前生成器的 Visual Studio 目标平台名称的默认值,而不考虑 CMAKE_GENERATOR_PLATFORM 变量的值。对于 VS 2017 及以下版本的 Visual Studio Generators,始终为 Win32。对于 VS 2019 及更高版本,这是基于主机平台的。

【讨论】:

    猜你喜欢
    • 2021-04-04
    • 1970-01-01
    • 2023-01-02
    • 2019-07-12
    • 1970-01-01
    • 2021-09-20
    • 1970-01-01
    • 1970-01-01
    • 2020-09-07
    相关资源
    最近更新 更多