Skip to content

Commit

Permalink
Extend 'linker dflags' detection for DMD
Browse files Browse the repository at this point in the history
-betterC, -L… and -Xcc=… influence linking.
  • Loading branch information
kinke authored and dlang-bot committed Jan 21, 2021
1 parent 24ca22d commit f65e2bd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
3 changes: 3 additions & 0 deletions changelog/dmd-linker-dflags.dd
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
More 'linker dflags' with DMD

`-betterC`, `-L…` and `-Xcc=…` `dflags` are now used for linking too.
9 changes: 5 additions & 4 deletions source/dub/compilers/dmd.d
Original file line number Diff line number Diff line change
Expand Up @@ -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=");
}
}
}

0 comments on commit f65e2bd

Please sign in to comment.