I have both GDC and DMD installed on windows, and am using DUB to build and test my project. DUB automatically uses DMD, but I would also like to use the GDC compiler through DUB. The DUB package reference here implies you can use different compilers, but doesn't specify how to do it.
I tried just removing DMD from my system path hoping that it would find GDC instead, but now it just complains that it can't find DMD.
You use dub --compiler=gdc
.
It's documented but somewhat unintuitively. You need to do dub build -h
(build is the default action).
The same option can be used to perform cross-compilation, e.g. dub build --compiler=arm-linux-gnueabihf-gdc
. See https://github.com/rejectedsoftware/vibe.d/issues/1079#issuecomment-111798195
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With