From bd99f0bf1cd3e591a174aa985153f3ec9819d235 Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Thu, 9 Nov 2023 14:55:06 -0500 Subject: [PATCH] rust: Make sure -l and -L are a single arg CompilerArgs would otherwise dedup and reorder them. --- mesonbuild/backend/ninjabackend.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py index 22af2500e..7ed6b443f 100644 --- a/mesonbuild/backend/ninjabackend.py +++ b/mesonbuild/backend/ninjabackend.py @@ -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)