May 10, 2022

On Tuesday, 10 May 2022 at 20:50:12 UTC, Alexander Zhirov wrote:

>

And if there are two compilers in the system - dmd and ldc, which compiler chooses dub.json?

It depends on whether your DMD or LDC installation comes first in your PATH environment variable. Both ship with a dub executable that uses their compiler as default.

>

And how do I specify the specific compiler I want?

On the command line you can use the --compiler=dmd flag. You can't specify this in the dub.json, since your project is supposed to be compiler agnostic.

May 11, 2022

On Tuesday, 10 May 2022 at 22:12:52 UTC, Dennis wrote:

>

It depends on whether your DMD or LDC installation comes first in your PATH environment variable. Both ship with a dub executable that uses their compiler as default.

I came across something else like this. Created a dub.settings.json file in the dub project, but still requires dmd:

$ dub
Performing "debug" build using dmd for x86_64.
app ~master: building configuration "application"...
Running pre-build commands...
Error: unrecognized switch '-Os'
       run `dmd` to print the compiler manual
       run `dmd -man` to open browser on manual
dmd failed with exit code 1.

dub.settings.json:

{
	"defaultArchitecture": "x86_64",
	"defaultCompiler": "ldc"
}
May 11, 2022

On Wednesday, 11 May 2022 at 05:11:10 UTC, Alexander Zhirov wrote:

>

dub.settings.json

It's written about it here

1 2
Next ›   Last »