Skip to content

Commit

Permalink
rust: Make sure -l and -L are a single arg
Browse files Browse the repository at this point in the history
CompilerArgs would otherwise dedup and reorder them.
  • Loading branch information
xclaesse committed Nov 9, 2023
1 parent 5170ef3 commit 714d782
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions mesonbuild/backend/ninjabackend.py
Original file line number Diff line number Diff line change
Expand Up @@ -1976,7 +1976,7 @@ def _link_library(libname: str, static: bool, bundle: bool = False):
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()
Expand Down Expand Up @@ -2048,9 +2048,8 @@ def _link_library(libname: str, static: bool, bundle: bool = False):
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)
Expand Down

0 comments on commit 714d782

Please sign in to comment.