-
-
Notifications
You must be signed in to change notification settings - Fork 228
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use DC env variable as the default compiler
- Loading branch information
1 parent
57f89af
commit d696b36
Showing
6 changed files
with
37 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Use DC environment variable as default D compiler | ||
|
||
dub now respects the `DC` environment variable, meaning that `DC=ldc2 dub build` will behave as `dub build --compiler=ldc2`. | ||
In case both are supplied, the `--compiler` switch still has priority. | ||
Note that when DUB recursively invokes itself, for example in `preGenerateCommands`, | ||
it sets the `DC` variable to the compiler it is using, meaning that nested dub invocation will now use the same compiler. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/usr/bin/env bash | ||
|
||
. $(dirname "${BASH_SOURCE[0]}")/common.sh | ||
cd ${CURR_DIR}/issue2012-dc-env | ||
|
||
$DUB app.d ${DC} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/usr/bin/env dub | ||
/+ dub.sdl: | ||
name "app" | ||
+/ | ||
|
||
import std.format; | ||
|
||
void main(string[] args) | ||
{ | ||
version (LDC) | ||
immutable expected = "ldc2"; | ||
version (DigitalMars) | ||
immutable expected = "dmd"; | ||
version (GNU) | ||
immutable expected = "gdc"; | ||
|
||
assert(expected == args[1], format!"Expected '%s' but got '%s'"(expected, args[1])); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters