aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/compilers/d.py
diff options
context:
space:
mode:
Diffstat (limited to 'mesonbuild/compilers/d.py')
-rw-r--r--mesonbuild/compilers/d.py21
1 files changed, 17 insertions, 4 deletions
diff --git a/mesonbuild/compilers/d.py b/mesonbuild/compilers/d.py
index 52126e3..9a46a4e 100644
--- a/mesonbuild/compilers/d.py
+++ b/mesonbuild/compilers/d.py
@@ -394,10 +394,23 @@ class DmdLikeCompilerMixin:
def get_soname_args(self, *args, **kwargs) -> T.List[str]:
# LDC and DMD actually do use a linker, but they proxy all of that with
# their own arguments
- soargs = []
- for arg in super().get_soname_args(*args, **kwargs):
- soargs.append('-L=' + arg)
- return soargs
+ if self.linker.id.startswith('ld.'):
+ soargs = []
+ for arg in super().get_soname_args(*args, **kwargs):
+ a, b = arg.split(',', maxsplit=1)
+ soargs.append(a)
+ soargs.append(self.LINKER_PREFIX + b)
+ return soargs
+ elif self.linker.id.startswith('ld64'):
+ soargs = []
+ for arg in super().get_soname_args(*args, **kwargs):
+ if not arg.startswith(self.LINKER_PREFIX):
+ soargs.append(self.LINKER_PREFIX + arg)
+ else:
+ soargs.append(arg)
+ return soargs
+ else:
+ return super().get_soname_args(*args, **kwargs)
def get_allow_undefined_link_args(self) -> T.List[str]:
args = self.linker.get_allow_undefined_args()