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.
pull/9131/head
Nirbheek Chauhan 3 years ago committed by Dylan Baker
parent d80baf8a2b
commit d6243e3ebd
  1. 6
      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}']

Loading…
Cancel
Save