解决方案范围内的预构建活动? [英] Solution-wide pre-build event?

查看:121
本文介绍了解决方案范围内的预构建活动?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Visual Studio中有一个解决方案,其中包含几个项目.我想在每个构建的开始都运行一个命令-无论涉及哪个项目以及它们是否是最新的.

I have a solution in Visual Studio which contains several projects. I'd like to run a command at the very beginning of every build - no matter which projects are involved and whether or not they are up-to-date.

基本上,我需要与解决方案范围内的预构建事件类似的东西,但不幸的是VS似乎不支持这些事件.有人知道实现我需要的替代方法吗?

Essentially I need something similar to a solution-wide pre-build event, but unfortunately VS does not appear to support these. Does anyone know an alternative way of achieving what I need?

推荐答案

不寻常的要求.但这是可以完成的.将新项目添加到您的解决方案中,使用Visual C ++>常规> Makefile项目模板.将其NMake>构建命令行设置设置为要执行的命令.使用项目">项目依赖项",使所有其他项目都依赖它.

Unusual requirement. But it can be done. Add a new project to your solution, use the Visual C++ > General > Makefile Project template. Set its NMake > Build Command Line setting to the commands you want to execute. Use Project > Project Dependencies to make all other projects depend on it.

这篇关于解决方案范围内的预构建活动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆