dmd as link driver

Walter Bright newshound2 at digitalmars.com
Fri Aug 13 01:02:25 PDT 2010


SK wrote:
> Can dmd drive the linking process in two step compile-then-link builds?
> 
> Lacking this capability complicates the CMake discovery process that 
> uses small test compiles.  In short, the problem is that CMake needs, 
> but does not have, full knowledge of the C environment (to handle 
> linking) before testing the D environment.  I'm not a cmake expert, but 
> I don't think I can express this dependency between two tool chains.  A 
> few experiments have failed to get this working.
> 
> If the answer is that dmd cannot drive the linker, would a patch be easy 
> enough to consider?


dmd does drive the linker. For example:

    dmd test

will compile test.d and link it to form the test.exe executable. Similarly,

    dmd test.obj

will just perform the link step.


More information about the Digitalmars-d mailing list