Skip to content

Commit

Permalink
determine_windows_extra_paths: sort internal dependencies first
Browse files Browse the repository at this point in the history
Fixes #12330
  • Loading branch information
lb90 committed Nov 18, 2024
1 parent 33376ef commit 2406ecc
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions mesonbuild/backend/backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -1179,25 +1179,32 @@ def determine_windows_extra_paths(
links to and return them so they can be used in unit
tests.
"""
result: T.Set[str] = set()
prospectives: T.Set[build.BuildTargetTypes] = set()
internal_deps: T.Set[str] = set()
external_deps: T.Set[str] = set()

if isinstance(target, build.BuildTarget):
prospectives.update(target.get_transitive_link_deps())
# External deps
result.update(self.extract_dll_paths(target))

for bdep in extra_bdeps:
prospectives.add(bdep)
if isinstance(bdep, build.BuildTarget):
prospectives.update(bdep.get_transitive_link_deps())

# Internal deps
for ld in prospectives:
dirseg = os.path.join(self.environment.get_build_dir(), self.get_target_dir(ld))
result.add(dirseg)
internal_deps.add(dirseg)

# External deps
if isinstance(target, build.BuildTarget):
external_deps.update(self.extract_dll_paths(target))

if (isinstance(target, build.BuildTarget) and
not self.environment.machines.matches_build_machine(target.for_machine)):
result.update(self.get_mingw_extra_paths(target))
return list(result)
external_deps.update(self.get_mingw_extra_paths(target))

return list(internal_deps) + list(external_deps)

def write_benchmark_file(self, datafile: T.BinaryIO) -> None:
self.write_test_serialisation(self.build.get_benchmarks(), datafile)
Expand Down

0 comments on commit 2406ecc

Please sign in to comment.