Setting versions for imports

Derek Parnell derek at psych.ward
Tue Oct 2 15:15:43 PDT 2007


On Tue, 02 Oct 2007 16:47:01 +0200, Jascha Wetzel wrote:

> Suppose we have two modules test1 and test2:
> 
> module test1;
> version(asdf) {}
> else { static assert(0); }
> 
> module test2;
> version = asdf;
> import test1;
> 
> This won't compile. Is there a way to get the intended behavior without 
> passing the versions on the command line?

The 'Bud' utility has some help for you. It supports a pragma that ensures
the 'version' gets passed to al files being compiled.

In any of the files to be compiled you have something like ...

  version(build) pragma(export_version, asdf);

and Bud causes "version=asdf" to be placed on the command line for you.

I'm not sure if Rebuild has a similar functionality, but I wouldn't be
surprised if it did.

-- 
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell


More information about the Digitalmars-d-learn mailing list