www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Temporarily adding -vgc to a DUB build

reply =?UTF-8?B?Tm9yZGzDtnc=?= <per.nordlow gmail.com> writes:
How do I temporarily enable -vgc when building my app with DUB?

I've tried

DFLAGS=-vgc /usr/bin/dub build --build=unittest

but it doesn't seem to have any effect as it doesn't rebuild 
directly after the call

/usr/bin/dub build --build=unittest

I'm using DUB version 1.5.0

Or is adding a new build configuration, say unittest-vgc, the 
only way to accomplish this?
Sep 16
parent reply Nicholas Wilson <iamthewilsonator hotmail.com> writes:
On Saturday, 16 September 2017 at 21:45:34 UTC, Nordlöw wrote:
 How do I temporarily enable -vgc when building my app with DUB?

 I've tried

 DFLAGS=-vgc /usr/bin/dub build --build=unittest

 but it doesn't seem to have any effect as it doesn't rebuild 
 directly after the call

 /usr/bin/dub build --build=unittest

 I'm using DUB version 1.5.0

 Or is adding a new build configuration, say unittest-vgc, the 
 only way to accomplish this?
Setting the dflags in the dub.json should work. This is what I use for dcompute: { ... "dflags" : ["-mdcompute-targets=cuda-210" ,"-oq", "-betterC"], ... } so just change those flags to "-vgc" should do the trick.
Sep 16
parent Igor <stojkovic.igor gmail.com> writes:
On Sunday, 17 September 2017 at 01:50:08 UTC, Nicholas Wilson 
wrote:
 On Saturday, 16 September 2017 at 21:45:34 UTC, Nordlöw wrote:
 How do I temporarily enable -vgc when building my app with DUB?

 I've tried

 DFLAGS=-vgc /usr/bin/dub build --build=unittest

 but it doesn't seem to have any effect as it doesn't rebuild 
 directly after the call

 /usr/bin/dub build --build=unittest

 I'm using DUB version 1.5.0

 Or is adding a new build configuration, say unittest-vgc, the 
 only way to accomplish this?
Setting the dflags in the dub.json should work. This is what I use for dcompute: { ... "dflags" : ["-mdcompute-targets=cuda-210" ,"-oq", "-betterC"], ... } so just change those flags to "-vgc" should do the trick.
You can also just execute: export DFLAGS=-vgc before running dub. That should work since as far as I know "export" is needed to make env var visible to other processes started from the same shell session.
Sep 17