Delphi DCU 文件保存在哪里?
目前我还没有在我的主项目中为 Delphi DCU 设置任何特定的输出目录。这会导致 DCU 文件最终位于与我的 .pas 源文件相同的目录中。对我来说,这感觉很丑陋,因为我不喜欢在同一目录中混合 .pas 和 .dcu 文件的想法。存储 Delphi .dcu 文件的最佳实践是什么 - 将它们全部保留在每个项目的一个目录中?或者为每个源文件夹创建一个 DCU 目录?欢迎任何想法。
Currently I have not set any specific output directory for Delphi DCUs in my main project. This results in the DCU files ending up in the same directory as my .pas source files. To me, this feels ugly as I don't like the idea of mixing .pas and .dcu files in the same directory. What is the best practice for storing Delphi .dcu files - keep them all one directory for each project? Or maybe create one DCU directory for each source folder? Any ideas welcome.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
最好的方法是为每个项目创建一个 DCU 文件夹,尤其是当您有多个项目使用相同文件时。否则,您最终可能会使用不同的编译器设置进行不同的编译,从而破坏彼此的 DCU。
The best way to do it is to create a DCU folder for each project, especially if you have more than one project that uses the same files. Otherwise, you can end up with different compiles with different compiler settings stomping each other's DCUs.
.dcu 还依赖于定义,例如调试与发布配置 (*)。
(*) 虽然 Delphi XE 允许将“配置”放在输出路径中,但恕我直言,这种解决方法比问题更糟糕
所以我定期从我执行所有 SVN 签出的目录根目录中递归删除所有 .dcu。
包含组件的目录带有 delphi 版本后缀,并且位于 SVN checkout 目录之外。
.dcu's are also dependant on defines, and e.g. debugging vs release configuration (*).
(*) While Delphi XE allows to put the "configuration" in the output path, IMHO that cure is worse than the problem
So I regularly recursively delete all .dcu's from the root of the dir where I do all my SVN checkouts.
The directory with components has a delphi version suffixed, and is outside the SVN checkout directory.
同意...在同一目录中混合 PAS 和 DCU 文件是“肮脏的”。
每当您启动一个新的应用程序、dll 或其他 Delphi 项目时,首先要做的事情之一就是设置输出目录。在 Delphi 的更高版本中,这是为您完成的,因为输出目录设置为 .\$(Config)\$(Platform),它与 Debug 或 Release 配置选项和 Win32 平台相关。 (最终得到 Debug\Win32 的默认输出目录)
如果您使用自定义编译器定义进行构建,那么明智的做法是使用不同的项目构建选项来为每组自定义编译器定义包含单独的输出目录,否则您必须执行完整的操作构建以确保正确构建单元。
Agreed...mixing PAS and DCU files in the same directory is 'dirty'.
Whenever you start a new application, dll, or other Delphi project, one of the first things to do is to set the output directory. In later versions of Delphi this is done for you as the output directory is set as .\$(Config)\$(Platform) which correlates to the Debug or Release config option and Win32 platform. (Ending up with a default output directory of Debug\Win32)
If you build with custom compiler defines then it would be wise to have different project build options to include separate output directories for each set of custom compiler defines otherwise you have to do a full build to ensure that units are built correctly.