我可以在构建事件中检测构建目标吗?

发布于 2025-01-04 18:08:28 字数 248 浏览 2 评论 0原文

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

我有一个预构建事件,它将许多 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 技术交流群。

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

发布评论

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

评论(1

紫南 2025-01-11 18:08:28

鉴于 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.

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