-
-
Notifications
You must be signed in to change notification settings - Fork 228
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use DC env variable as the default compiler #2047
Conversation
Thanks for your pull request and interest in making D better, @omerfirmak! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please see CONTRIBUTING.md for more information. If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment. |
Any ideas on how to unittest this? |
d31d7c4
to
4e126a7
Compare
Probably there are cleaner approaches, but the first thing that comes to my mind is this: void main()
{
version (LDC)
return 1;
else version (DigitalMars)
return 2;
// and so on.
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another way to test it is:
void main (string[] args)
{
version (LDC)
immutable expected = "ldc2";
// ...
assert(expected == args[1], format!"Expected '%s' but got '%s'"(expected, args[1]);
}
9680c91
to
68f34d7
Compare
Thanks for the reviews! Added the test. |
68f34d7
to
d696b36
Compare
Travis seems to be stuck. |
When DUB recursively invokes itself, it sets up the DC
env var with the compiler it is using. The
callee
dub shoulduse that compiler if it is not overriden with "--compiler".
DC=ldc2 dub build
is equivalent todub build --compiler=ldc2
DC=ldc2 dub build --compiler=dmd
would usedmd
This addresses the issue 1 mentioned in #2012