如何使用MSVC2017和CMAKE定位Windows XP?

发布于 2025-02-01 03:02:06 字数 889 浏览 2 评论 0原文

我想完成其他2个线程正在做的事情,但是使用最新的MSVC来支持定位Windows XP和CMake支持。

我一直遵循我如何生成一个带有cmake Windows XP的Visual Studio 2012项目? cmake如何为Visual Studio 2015项目指定“平台工具集”?,但是Cmake不断告诉我,它为Windows 10.foo配置了源代码.bar SDK版本无法正常工作。我尝试将hamfist v141_xp作为cmake_generator_toolset和cmake的-t参数,但最终都失败了。我该怎么做?如果可能的话,我可以在cmakesettings.json中在哪里指定?

AMD64支持的奖励积分,因为我想制作的目标系统是Windows XP X64。

对于它的价值,我尝试打开一个.sln文件,并确认可以作为平台工具集使用V141_XP。

I wanted to accomplish what other 2 threads are doing, but with latest MSVC to support targetting Windows XP and CMake support.

I keep following the advice given in How can I generate a Visual Studio 2012 project targeting Windows XP with CMake? and How does CMake specify "Platform Toolset" for a Visual Studio 2015 project? but CMake keeps telling me that it configured the source code for Windows 10.foo.bar SDK version which is not going to work. I tried hamfisting v141_xp into the project as CMAKE_GENERATOR_TOOLSET and -T parameter for cmake but it all ultimately fails. How can I accomplish this? And if possible, where can I specify this in CMakeSettings.json?

Bonus points for amd64 support, since the target system I want to make binaries for is Windows XP x64.

For what it's worth, I have tried to open a .sln file and I confirm that v141_xp is available as a platform toolset.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

抱着落日 2025-02-08 03:02:06

我自己想知道。来自X64工具控制台:

  1. 准备.sln文件
cmake path/to/CMakeLists.txt -G "Visual Studio 15 2017 Win64" -A x64 -T v141_xp
  1. 从.sln构建:
msbuild path/to/.sln /p:XPDeprecationWarning=false /p:Platform=x64

I figured it out on my own. From x64 tools console:

  1. Prepare .sln files
cmake path/to/CMakeLists.txt -G "Visual Studio 15 2017 Win64" -A x64 -T v141_xp
  1. Build from .sln:
msbuild path/to/.sln /p:XPDeprecationWarning=false /p:Platform=x64
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文