ninjabackend: Use the right ranlib for static linker rules

Fixes https://github.com/mesonbuild/meson/issues/12349
1.2
Nirbheek Chauhan 1 year ago
parent 5f86d62e91
commit 639ed002fc
  1. 7
      mesonbuild/backend/ninjabackend.py

@ -2366,7 +2366,12 @@ class NinjaBackend(backends.Backend):
# ranlib, not to ar
cmdlist.extend(args)
args = []
cmdlist.extend(['&&', 'ranlib', '-c', '$out'])
# Ensure that we use the user-specified ranlib if any, and
# fallback to just picking up some ranlib otherwise
ranlib = self.environment.lookup_binary_entry(for_machine, 'ranlib')
if ranlib is None:
ranlib = ['ranlib']
cmdlist.extend(['&&'] + ranlib + ['-c', '$out'])
description = 'Linking static target $out'
if num_pools > 0:
pool = 'pool = link_pool'

Loading…
Cancel
Save