On Tuesday, 8 August 2017 at 10:07:54 UTC, data pulverizer wrote:
On Tuesday, 8 August 2017 at 09:51:40 UTC, Moritz Maxeiner
If your code depends on capabilities of a specific D compiler,
I wouldn't depend on build tools for that, I'd make it clear
in the source code via conditional compilation :
else version (LDC)
static assert (0, "Unsupported D compiler");
There's no equivalent for the frontend version, though AFAIK.
If it's not your code that needs something compiler specific,
but you just want to control which is used, don't use dub as a
build tool, use another (cmake, meson, write your own
compilation "script" in D), and set it's invocation as a
prebuildcommand in the dub package file (make sure dub's
source file list is empty).
I'll note that you can specify that dub use a particular D
compiler for building all your own D packages, by creating a file
called .dub/settings.json in your home directory, and putting the
full path to the compiler you want in there, like so:
Ldc uses a file like that to make sure the dub binary it comes
with uses ldc, not dmd, so you can look at that file for an
However, it sounds like you want to ensure that all users of a
package are forced to use a particular D compiler, while this
will just make sure that your dub binary will always use the D
compiler you want.