diff --git a/changelog/dmd-linker-dflags.dd b/changelog/dmd-linker-dflags.dd new file mode 100644 index 000000000..3628792e6 --- /dev/null +++ b/changelog/dmd-linker-dflags.dd @@ -0,0 +1,3 @@ +More 'linker dflags' with DMD + +`-betterC`, `-L…` and `-Xcc=…` `dflags` are now used for linking too. \ No newline at end of file diff --git a/source/dub/compilers/dmd.d b/source/dub/compilers/dmd.d index 20fd57c9f..e7feeb861 100644 --- a/source/dub/compilers/dmd.d +++ b/source/dub/compilers/dmd.d @@ -361,11 +361,12 @@ config /etc/dmd.conf static bool isLinkerDFlag(string arg) { switch (arg) { - default: - if (arg.startsWith("-defaultlib=")) return true; - return false; - case "-g", "-gc", "-m32", "-m64", "-shared", "-lib", "-m32mscoff": + case "-g", "-gc", "-m32", "-m64", "-shared", "-lib", "-m32mscoff", "-betterC": return true; + default: + return arg.startsWith("-L") + || arg.startsWith("-Xcc=") + || arg.startsWith("-defaultlib="); } } }