我可以在构建事件中检测构建目标吗?
我想在构建事件中检测构建目标,即 make
或 build
。
我有一个预构建事件,它将许多 C 文件编译成对象 (.obj),然后将其包含在我的 Pascal 文件之一中。目前,每次预构建事件运行时都会编译 C 文件。如果构建目标是 make 并且对象是最新的,我希望能够跳过此阶段。
能够跳过此阶段将使我在编辑/编译/调试开发模式下显着减少编译时间。
那么,是否可以检测构建目标?
I would like to detect the build target, i.e. make
or build
, in a build event.
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
鉴于 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.