www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - How can I structure a Meson build project in D to use DUB.

reply Mike Brockus <michaelbrockus icloud.com> writes:
How can I structure a Meson build project in D to use dub as a 
method for dependencies like urld, d2sqlite or unit-threaded?

If that is not what Meson users of D do then what is the pure 
Meson of things way?

C https://github.com/squidfarts/c-example
D https://github.com/squidfarts/d-example
May 28 2019
parent reply GoaLitiuM <goalitium dforums.mail.kapsi.fi> writes:
On Tuesday, 28 May 2019 at 18:11:09 UTC, Mike Brockus wrote:
 How can I structure a Meson build project in D to use dub as a 
 method for dependencies like urld, d2sqlite or unit-threaded?

 If that is not what Meson users of D do then what is the pure 
 Meson of things way?

 C https://github.com/squidfarts/c-example
 D https://github.com/squidfarts/d-example
You simply change the method to dub for dependencies, as shown here: https://github.com/mesonbuild/meson/blob/master/test%20cases/d/11%20dub/meson.build#L8
May 28 2019
next sibling parent GoaLitiuM <goalitium dforums.mail.kapsi.fi> writes:
On Tuesday, 28 May 2019 at 18:13:17 UTC, GoaLitiuM wrote:
 On Tuesday, 28 May 2019 at 18:11:09 UTC, Mike Brockus wrote:
 How can I structure a Meson build project in D to use dub as a 
 method for dependencies like urld, d2sqlite or unit-threaded?

 If that is not what Meson users of D do then what is the pure 
 Meson of things way?

 C https://github.com/squidfarts/c-example
 D https://github.com/squidfarts/d-example
You simply change the method to dub for dependencies, as shown here: https://github.com/mesonbuild/meson/blob/master/test%20cases/d/11%20dub/meson.build#L8
(Maybe I posted too quickly without reading the post fully...) As for structuring, there is no special handling for dub projects specifically in Meson, but the dub dependencies must be fetched and built for the same compiler you have setup your Meson build to use, as Meson does not try to build the dependencies for you.
May 28 2019
prev sibling parent Mike Brockus <michaelbrockus icloud.com> writes:
On Tuesday, 28 May 2019 at 18:13:17 UTC, GoaLitiuM wrote:
 On Tuesday, 28 May 2019 at 18:11:09 UTC, Mike Brockus wrote:
 How can I structure a Meson build project in D to use dub as a 
 method for dependencies like urld, d2sqlite or unit-threaded?

 If that is not what Meson users of D do then what is the pure 
 Meson of things way?

 C https://github.com/squidfarts/c-example
 D https://github.com/squidfarts/d-example
You simply change the method to dub for dependencies, as shown here: https://github.com/mesonbuild/meson/blob/master/test%20cases/d/11%20dub/meson.build#L8
So how does it work? Should the dependency be downloaded already or will the dub method get the package from a repository of some kind?
May 28 2019