Skip to content

Commit

Permalink
build: use self.compilers instead of all_compilers for stdlib langs
Browse files Browse the repository at this point in the history
We need a union of the compilers used by the target, and by those used
by all dependencies, not all the compilers in all projects. We do,
however, need to look compilers up from all possible compilers, as a
dependency that is a subproject could use a language not present in the
current project.
  • Loading branch information
dcbaker authored and eli-schwartz committed Jul 5, 2023
1 parent d391e52 commit 8369dbb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mesonbuild/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -1630,10 +1630,13 @@ def get_clink_dynamic_linker_and_stdlibs(self) -> T.Tuple['Compiler', T.List[str

def get_used_stdlib_args(self, link_language: str) -> T.List[str]:
all_compilers = self.environment.coredata.compilers[self.for_machine]
all_langs = set(all_compilers).union(self.get_langs_used_by_deps())
all_langs = set(self.compilers).union(self.get_langs_used_by_deps())
stdlib_args: T.List[str] = []
for dl in all_langs:
if dl != link_language and (dl, link_language) not in self._MASK_LANGS:
# We need to use all_compilers here because
# get_langs_used_by_deps could return a language from a
# subproject
stdlib_args.extend(all_compilers[dl].language_stdlib_only_link_flags(self.environment))
return stdlib_args

Expand Down

0 comments on commit 8369dbb

Please sign in to comment.