tags:

views:

314

answers:

5

I'm producing builds using MSBuild, and build configurations set up in the dproj on the command line. It's slightly disconcerting that the size of the executables thus produced are different (not by much, but still!) to what an IDE build produces. Any ideas why? I would have thought the same compiler is used?

+9  A: 

The main power of building from the Delphi command-line compiler is standardization - you explicitly identify the options (on the command line, in the .cfg files, etc), and the compiler follows the options provided exclusively. In contrast, the IDE has many other behaviors that are not clear and explicit - for example, it may search library paths not specified in the Project Options. My guess is that something's happening in the IDE build of which you're not entirely aware - and this is why standardized builds are done from the command line.

Argalatyr
+8  A: 

To see what IDE is doind, check

Tools | Options | Environment Options | Compiling and Running | Show Command Line

And you can check the compiler messages.

Cesar Romero
A: 

This behavior has existed in every version of Delphi I've used. (5 - 2006). I wouldn't worry to much about it. When I first discovered it I spent a lot of time trying to resolve the difference. Did I miss a compiler flag? Is there a discrepancy between the IDE and the command line compiler's supported options?

In the end I decided it wasn't that big of an issue. Both consistently produced functionally equivalent executables.

codeelegance
A: 

If you supply exactly the same params to the command line compiler the produced executables will virtually be identical.

In fact the IDE just calls the commandline compiler. Compile your project in the IDE and look at the messages window. you will see the full dcc32.exe call ...

Olaf Monien
How does this help the OP to actually do that supplying, though?
Matthew Flaschen
It helps in the way that you can make sure that /could/ control your build tool (Steve mentioned MSBuild in his question) to compile *exactly* in the same way as you do from Delphi's IDE.
Olaf Monien
+3  A: 

The first answer on using the command line for build consistency is right on and it is probably something you needn't worry about if you are relying on a build system where production files are always sourced from the console builds.

On the other hand, if you really do want to figure out what is going on you should turn on map files (at the full detail level) and compare/diff them. If there are differences between the two they will show up there. Any other differences that may exist are likely a result of a commmand line option being different (such as a conditional flag that may be set in the IDE settings).

Ryan VanIderstine
+1 for map file recommendation. They seem to have much less focus now days, but are still very valid for knowing what is actually used by the application.
skamradt