Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.1k views
in Technique[技术] by (71.8m points)

delphi - How can I pass a parameter through MSBuild to the compiler?

I'm using the line below to have MSBuild build a Delphi 2010 groupproj:

   MSBuild C:srcmyprojgroup.groupproj  /target:Build /p:config=Release

I can't figure out how to modify the line above so that I can pass this argument

   -EC:mypath

to the compiler (bcc32.exe).

I've spent a fair amount of time trying to find this on the web. /property:name=value seemed likely to be what I need, but hasn't thus far.

Is this even possible, or do I have to learn about MSBUILD configuration files now...

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Tom --

Probably the easiest way to do this would be to open the project in the IDE, set the settings in the IDE that you want, and then save.

Even better would be to set up a specific build configuration for these settings, and use that.

The IDE uses MSBuild itself, so any settings that you make in the IDE are saved in the *.DPROJ file (or GROUPPROJ, in your case), and so when you execute the command line, the exact same settings are used as were set in the IDE. If you use a specific build configuration for this specific set of options, you can simply call that configuration on the command line and you'll get what you want.

In other, shorter words: Let the IDE do the work for you.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...