如何将 32 位和 64 位 DCU 编译到单独的目录中? [英] How can I compile 32- and 64-bit DCUs into separate directories?

查看:26
本文介绍了如何将 32 位和 64 位 DCU 编译到单独的目录中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图维护一个存储库,我的代码库中的大部分内容都是源代码,但我们有 QuickPDF 库,它是一堆预编译的 DCU.我想以某种方式将它们置于版本控制中,但我不想在将我的万亿 LOC 代码库的其余部分转换为 win64 之前为 win64 设置另一个选项.

I'm trying to maintain one repository, most everything in my code base is source, but we've got the QuickPDF library which is a bunch of precompiled DCU's. I'd like to put them in version control somehow but I don't want to have yet another option set for win64 that I'm going to forget about before I convert the rest of my trillion LOC codebase to win64.

我所想的只是拥有(quickPDF 只是一个例子,除了不幸的预编译之外,这个库没有什么特别之处)

What I was thinking was just having (and quickPDF is just an example, there's nothing special about this library other than its unfortunate precompiledness)

  • ctrlsquickpdfQuickPDF.pas
  • ctrlsquickpdfwin32[*.dcu]
  • ctrlsquickpdfwin64[*.dcu]

从 Program Files 中文件夹的外观来看,Embarcadero 对 VCL 做了类似的事情.那里甚至还有一些预编译的东西,比如 VCL.Imaging.JPEG.pas.

From the looks of the folders in Program Files, Embarcadero does something similar with the VCL. There are even some precompiled things there, like VCL.Imaging.JPEG.pas.

我如何做同样的事情?我是否需要指定 win32 和 win64 文件夹,或者我可以在某处使用什么魔法?

How do I do the same thing? Do I need to specify win32 and win64 folders, or is there some magic somewhere I can tap in to?

推荐答案

可以在普通 XE2 VCL Forms 应用程序的 .dproj 文件中看到您所谈论的魔法.关键因素是这些变量:

The magic you are talking about can be seen in the .dproj file for a plain vanilla XE2 VCL Forms app. The key ingredients are these variables:

  • $(Platform) 在 Windows 上可以是 Win32 或 Win64.
  • $(Config) 通常是 Debug 或 Release.
  • $(Platform) which can be Win32 or Win64 on Windows.
  • $(Config) which is commonly either Debug or Release.

然后在 .dproj 文件中,以下 XML 执行魔术:

Then in the .dproj file the following XML performs the magic:

<PropertyGroup Condition="'$(Base)'!=''">
    <DCC_DcuOutput>.$(Platform)$(Config)</DCC_DcuOutput>
    <DCC_ExeOutput>.$(Platform)$(Config)</DCC_ExeOutput>
</PropertyGroup>

您可以使用带有任何项目选项的 $(Platform)$(Config) 变量的此类技巧.因此,您只需要使用这些变量来设置编译器需要设置的任何选项,以找到您的预编译 DCU.

You can use such tricks with the $(Platform) and $(Config) variables with any of the project options. So you just need to use these variables to set whatever option needs to be set for the compiler to find your pre-compiled DCUs.

据我所知,您需要设置的选项是搜索路径.虽然我承认我对搜索路径的工作方式很模糊,因为我个人从不依赖搜索路径,并且总是在我的项目中明确包含所有源文件.在您的示例中,您将 ctrlsquickpdf($Platform) 添加到搜索路径.

To the best of my knowledge the option you need to set is the Search Path. Although I admit to being hazy about how the search path works since I personally never rely on search path and always explicitly include all source files in my projects. In your example you would add ctrlsquickpdf($Platform) to the search path.

这篇关于如何将 32 位和 64 位 DCU 编译到单独的目录中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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