Delphi predefined environment variables

て烟熏妆下的殇ゞ 提交于 2019-12-05 20:20:19

问题


Can anyone tell me where to find a list of the "pseudo" environment variables available in RAD Studio? The ones like $(Platform), $(Config), and so on. Specifically, I want one which gives me the RTL version, so that I can put my compiled units (*.dcu) into the correct directory, ie. D15 for XE, D16 for XE2, etc.

I was hoping that there would be one of these which corresponds with the "RTLVersion" compiler conditional definition, but $(RTLVersion) doesn't work.


回答1:


There is not a RTLVersion variable but you can create easily using the option Enviroment variables

or the windows registry.

For Delphi XE Check this entry

HKEY_CURRENT_USER\Software\Embarcadero\BDS\8.0\Environment Variables 

Then you can create a new variable called RTLVersion

And then from the Delphi IDE you can use like so




回答2:


Have you tried $(ProductVersion)? this will not give you D16, but contains the BDS product version 9.0 for XE2.

Unfortunately my XE2 Demo version is expired so I can't verify myself if it works. You'll find the definition bin\CodeGear.Common.Targets

Update: The ProductVersion define is new in XE2, so it won't work in older versions, but since its newly added, the possibility is high that it will be maintained by embarcadero in future versions.




回答3:


There is no environment variable for the RTL version. You will have to create a separate project for each version and then tweak the output folders as needed.



来源:https://stackoverflow.com/questions/7642891/delphi-predefined-environment-variables

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!