Visual Studio 版本的宏

发布于 2024-10-09 15:43:50 字数 195 浏览 0 评论 0原文

我正在使用命令行来自动化项目中的一些操作。我使用了很多宏,例如 $(PlatformName) - 为我提供了 Win32 或 Win64,它可以帮助我为所有配置类型编写命令。我想知道是否有一个类似的宏可以用于当前版本的 Visual Studio,例如返回 VS2008VS2010 的宏。

I am using the command line to automate a few things in my project. I am using a lot of macros, for example $(PlatformName) - gives me Win32 or Win64, which help me write commands for all configuration types. I am wondering if there is a similar macro that I can use for the current version of Visual Studio, for example one that will return VS2008 or VS2010.

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

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

发布评论

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

评论(2

橘亓 2024-10-16 15:43:50

看起来不像。 这里是可用宏的列表 。但是,这并不能保证没有其他方法可以检测正在使用的 VC 版本;一种选择可能是通过探索子目录从 VCinstalldir 中解决该问题。就像任何构建系统活动一样,这很快就会变成很多特殊情况等等......

It doesn't look like it. Here is a list of available macros. That's no guarantee there aren't other ways to detect the VC version in use, however; one option might be to work it out from the VCinstalldir by exploring subdirectories. Like any buildsystem activity this rapidly becomes a lot of special cases etc...

白云悠悠 2024-10-16 15:43:50

不确定 VS2008 是否明确,但 VS2010 和 VS2012 提供的 $(VisualStudioVersion) 值分别为 10.0 和 11.0。

Not sure about VS2008 explicitly but VS2010 and VS2012 offer $(VisualStudioVersion) with values of 10.0 and 11.0 respectively.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文