aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2021-08-18 04:31:45 +0530
committerDylan Baker <dylan@pnwbakers.com>2021-08-17 19:58:23 -0700
commitd6243e3ebd43a44aebf4e403cb19b3d881aedee5 (patch)
tree9563b187f5dd92384324b6bbe8a8ae618025c20e
parentd80baf8a2b3f520f8c95cd02dbc3704b53dcfa5b (diff)
downloadmeson-d6243e3ebd43a44aebf4e403cb19b3d881aedee5.zip
meson-d6243e3ebd43a44aebf4e403cb19b3d881aedee5.tar.gz
meson-d6243e3ebd43a44aebf4e403cb19b3d881aedee5.tar.bz2
rust targets: lld-link is the same as link for static libs
Without this, rustc will fail to find libfoo.a; same as with MSVC.
-rw-r--r--mesonbuild/backend/ninjabackend.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py
index 68c63b2..9b249c3 100644
--- a/mesonbuild/backend/ninjabackend.py
+++ b/mesonbuild/backend/ninjabackend.py
@@ -1694,9 +1694,9 @@ class NinjaBackend(backends.Backend):
args += ['--extern', '{}={}'.format(d.name, os.path.join(d.subdir, d.filename))]
elif d.typename == 'static library':
# Rustc doesn't follow Meson's convention that static libraries
- # are called .a, and implementation libraries are .lib, so we
- # have to manually handle that.
- if rustc.linker.id == 'link':
+ # are called .a, and import libraries are .lib, so we have to
+ # manually handle that.
+ if rustc.linker.id in {'link', 'lld-link'}:
args += ['-C', f'link-arg={self.get_target_filename_for_linking(d)}']
else:
args += ['-l', f'static={d.name}']