我可以在构建事件中检测到构建目标吗? [英] Can I detect the build target in a build event?

查看:167
本文介绍了我可以在构建事件中检测到构建目标吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在构建事件中检测构建目标,即 make build

I would like to detect the build target, i.e. make or build, in a build event.

我有一个预构建事件,可以将多个C文件编译成对象(.obj),然后将其包含在我的一个Pascal文件中。每次构建前事件运行时,C文件都将被编译。如果构建目标是 make ,并且对象是最新的,我希望能够跳过此阶段。

I have pre-build event that compiles a number of C files into objects (.obj) which are then included in one of my Pascal files. At the moment the C files are compiled every time the pre-build event runs. I would like to be able to skip this stage if the build target is make and if the objects are up-to-date.

在编辑/编译/调试开发模式下,能够跳过这个阶段可以大大减少编译时间。

Being able to skip this stage would give me significant reductions in compile time whilst in edit/compile/debug development mode.

所以,是否可以检测构建目标?

So, is it possible to detect the build target?

推荐答案

鉴于IDE只能一次编译一个项目,一个解决方案是注册一个IOTAProjectCompileNotifier。根据CompileInfo.Mode的值,它可以删除BeforeCompile中的构建事件,并将其添加到AfterCompile中。

Given that the IDE will only compile a single project at a time, one solution would be to register an IOTAProjectCompileNotifier. Depending on the value of CompileInfo.Mode, it could remove the build event in BeforeCompile and add it back in AfterCompile.

这篇关于我可以在构建事件中检测到构建目标吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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