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

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

问题描述

我正在努力维护一个存储库,我的代码库中的大部分内容都是源代码,但是我们有一堆预编译的DCU的QuickPDF库。我想把它们放在版本控制中,但是我不想再为win64设置另外一个选项,我将把剩下的我的万亿个代码库转换成win64,我将会忘记。



我在想的只是(而quickPDF只是一个例子,除了不幸的预编译之外,这个图书馆没有什么特别的)




  • ctrls\quickpdf\QuickPDF.pas

  • ctrls\quickpdf\win32 [*。dcu]

  • ctrls\quickpdf\win64 [*。dcu]



从程序文件中的文件夹看,Embarcadero类似于VCL的东西。还有一些预编译的东西,如VCL.Imaging.JPEG.pas。



我该怎么做同样的事情?我需要指定win32和win64文件夹,还是有一些魔法可以点击?

解决方案

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




  • $(Platform)可以是Win32或Win64在Windows上。

  • $(Config)通常是调试或发布。



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

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

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



据我所知,该选项您需要设置的是搜索路径。虽然我承认自己对搜索路径的工作模糊不清,因为我个人从不依赖搜索路径,并且始终将所有源文件显式地包含在我的项目中。在您的示例中,您将添加 ctrls\quickpdf\($ Platform)到搜索路径。


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.

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)

  • ctrls\quickpdf\QuickPDF.pas
  • ctrls\quickpdf\win32[*.dcu]
  • ctrls\quickpdf\win64[*.dcu]

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.

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?

解决方案

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) which can be Win32 or Win64 on Windows.
  • $(Config) which is commonly either Debug or Release.

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>

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.

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 ctrls\quickpdf\($Platform) to the search path.

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

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