dub: how to reference a compiled package

Mike Parker via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Feb 25 22:38:19 PST 2016


On Friday, 26 February 2016 at 04:03:15 UTC, BBasile wrote:

>
> The D interface file must be specified to DUB using
>
> "sourceFiles" : ["folder/interface.di"],
>
> either in a config or in the globals.
>
> The binary, so either a .lib | .a or .obj | .o must be 
> specified to DUB using
>
> "DFlags" : ["folder/binary.a"],
>
> Here again also accepted in a config or the globals.
>
> This is because DUB doesn't consider such binary as source file 
> but DMD or LDMD2 will accept them as source in the command line.
>
> e.g the DMD equivalent for the two previous example is
>
> DMD "sourceThis.d" "folder/interface.di" "folder/binary.a" 
> -ofbin/thesoft

Why? As long as the interface file is on the import path, it 
shouldn't need to be passed along to DMD. When you import 
foo.bar, the compiler will look for both foo/bar.di and foo/bar.d.


More information about the Digitalmars-d-learn mailing list