aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2020-03-10 10:13:03 -0700
committerDylan Baker <dylan@pnwbakers.com>2020-03-11 09:27:10 -0700
commit92e80d54e531dbf89b8cb74b2e54ee6f8f9f896b (patch)
treeda365e06ea1ff23f495cd950e7a4fecaebdbaf15 /mesonbuild
parentf13608460959af6c17081e7ee82f45c4a7541feb (diff)
downloadmeson-92e80d54e531dbf89b8cb74b2e54ee6f8f9f896b.zip
meson-92e80d54e531dbf89b8cb74b2e54ee6f8f9f896b.tar.gz
meson-92e80d54e531dbf89b8cb74b2e54ee6f8f9f896b.tar.bz2
compilers/d: Properly pass -soname args
Diffstat (limited to 'mesonbuild')
-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()