rust: Make sure -l and -L are a single arg

CompilerArgs would otherwise dedup and reorder them.
This commit is contained in:
Xavier Claessens 2023-11-09 14:55:06 -05:00
parent d25d8e2772
commit bd99f0bf1c
1 changed files with 3 additions and 4 deletions

View File

@ -1976,7 +1976,7 @@ class NinjaBackend(backends.Backend):
modifiers.append(verbatim)
if modifiers:
type_ += ':' + ','.join(modifiers)
args.extend(['-l', f'{type_}={libname}'])
args.append(f'-l{type_}={libname}')
linkdirs = mesonlib.OrderedSet()
external_deps = target.external_deps.copy()
@ -2042,9 +2042,8 @@ class NinjaBackend(backends.Backend):
args.append(f'-Clink-arg={a}')
for d in linkdirs:
if d == '':
d = '.'
args += ['-L', d]
d = d or '.'
args.append(f'-L{d}')
# Because of the way rustc links, this must come after any potential
# library need to link with their stdlibs (C++ and Fortran, for example)