dub for lib & app?

Andre Pany andre at s-e-a-p.de
Tue Feb 4 09:21:17 UTC 2020


On Tuesday, 4 February 2020 at 09:13:48 UTC, mark wrote:
> Is it possible to create a dub project that has one library and 
> one or more executables (that use the library)? If so, could 
> someone point me to the docs for this since I couldn't find 
> this in the dub docs?
>
> Aside: I'm learning D to give me something approaching the 
> convenience of Python with the fast executable that I'd get 
> with Rust. I love Rust's cargo tool, but find that Rust is very 
> frustrating to do prototyping or experimentation whereas D 
> seems easy for these purposes. But dub does seem a bit basic 
> (or maybe I just haven't found the right docs).

Yes, using sub packages. Set the targetType of the root package 
to None and introduce 2 sub packages of targetType Executable and 
Library.

Kind regards
Andre


More information about the Digitalmars-d-learn mailing list