Skip to content

Commit

Permalink
ninja: Dedupe Swift link args of external deps
Browse files Browse the repository at this point in the history
To avoid warnings about duplicate “-l” flags.
  • Loading branch information
oleavr committed Apr 10, 2024
1 parent d86ef0a commit 24799e0
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion mesonbuild/backend/ninjabackend.py
Original file line number Diff line number Diff line change
Expand Up @@ -2143,7 +2143,17 @@ def determine_swift_external_dep_link_args(self, target, swiftc):
if isinstance(d, build.StaticLibrary):
for dep in d.get_external_deps():
args += swiftc.get_dependency_link_args(dep)
return args

deduped_args = []
seen_libs = set()
for arg in args:
if arg.startswith("-l"):
if arg not in seen_libs:
deduped_args.append(arg)
seen_libs.add(arg)
else:
deduped_args.append(arg)
return deduped_args

def get_swift_link_deps(self, target):
result = []
Expand Down

0 comments on commit 24799e0

Please sign in to comment.