Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to force DUB to use gdc over dmd?

Tags:

d

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.

like image 867
Ryan Avatar asked Oct 14 '14 16:10

Ryan


1 Answers

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

like image 152
eco Avatar answered Nov 04 '22 08:11

eco