Get to know your compiler
by
, 10-14-2009 at 09:44 AM (1045 Views)
As many of you know, I use Delphi quite a bit at work, and also like using jEdit for my code editor. Yesterday, I started looking at what it would take to build projects from command-line so I could just work in jEdit for everything except form layout.
This is where things got ugly. It turns out that Delphi provides two incompatible methods for compiling a project. The first method is to build your project from within the IDE. This will use all of your settings for third party components and usually works flawlessly (assuming bug-free code). The other is to call dcc32.exe from the command-line. It turns out that the command-line version of the compiler has no awareness of the IDE's configuration! Worse, there appears to be no mechanism for exporting the IDE configuration to dcc32.cfg (which stores command-line compiler options).
It turns out that there are tools available that are specifically designed to read the IDE configuration and pass that information to dcc32.exe for you, but even then it's doing some trickery that makes it very difficult.
Get to know your command-line compiler early. If you can write a batch file, make file, or shell script to handle compilation for you, you're in good shape. Plan to be able to build projects in an automated way early. As JCoder has noted, a large program can take a while to build. Compiling a bunch of programs can take even longer, and you don't want to do it by loading each individual program into your IDE and clicking on Build.











