将此宏设置为构建环境中的环境变量?(set this macro as an environment variable in the build environment?)

编程入门 行业动态 更新时间:2024-10-26 01:23:40
将此宏设置为构建环境中的环境变量?(set this macro as an environment variable in the build environment?)

在Visual Studio中有一个选项,在项目属性表中设置说的宏

set this macro as an environment variable in the build environment

例如在下面的窗口中:

这个复选框的目的是什么? 我在VS中定义了很多宏,并且勾选或取消选中此复选框到目前为止并未显示任何明显的用途。

There is an option in Visual Studio when setting macros in project property sheets that says

set this macro as an environment variable in the build environment

for example in below window:

What is the purpose of this checkbox? I have a lot of macros defined in VS, and having this checkbox checked or unchecked does not show any apparent purpose so far.

最满意答案

好的,我在下面的问题中有Hans Passant发布的测试建议,并提出了一个好主意!

通过在属性表中使用构建事件,从Visual Studio中运行MSYS2 shell。

属性表,该宏定义了一个set this macro as an environment variable in the build environment

当我构建项目时,它会打开MSYS2 shell并将所有宏导入到shell中。

现在我只需将附加到项目的bash shell脚本调用并让Visual Studio使用GNU构建系统! 是!

Visual Studio中的自动工具。 谢谢汉斯!

Ok, I have testing suggestion posted by Hans Passant in comment below my question and come up with good idea!

Run MSYS2 shell from within Visual Studio, by using build event in property sheet.

property sheet that defines a macro with set this macro as an environment variable in the build environment

When I build project it opens MSYS2 shell and import all the macros into the shell.

Now I just call bash shell script attached to project and have Visual Studio use GNU build system!! YES!

autotools in Visual Studio. Thanks Hans!

更多推荐

本文发布于:2023-07-20 02:54:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1192072.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:将此   设置为   环境变量   环境   set

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!