Skip to content

Commit

Permalink
cmake: pass clib_compiler to resolve_cmake_trace_targets()
Browse files Browse the repository at this point in the history
This is required to resolve ambiguous LINK_LIBRARIES passed as bare
names.
  • Loading branch information
Akaricchi committed Oct 6, 2024
1 parent 7cb3674 commit 35dc1ec
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion mesonbuild/cmake/interpreter.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,8 @@ def __init__(self, target: CMakeTarget, env: 'Environment', for_machine: Machine

self.generated_raw: T.List[Path] = []

self.clib_compiler = None

for i in target.files:
languages: T.Set[str] = set()
src_suffixes: T.Set[str] = set()
Expand All @@ -275,6 +277,10 @@ def __init__(self, target: CMakeTarget, env: 'Environment', for_machine: Machine
# Register the new languages and initialize the compile opts array
for lang in languages:
self.languages.add(lang)

if self.clib_compiler is None:
self.clib_compiler = self.env.coredata.compilers[self.for_machine].get(lang)

if lang not in self.compile_opts:
self.compile_opts[lang] = []

Expand Down Expand Up @@ -345,7 +351,7 @@ def postprocess(self, output_target_map: OutputTargetMap, root_src_dir: Path, su
if tgt:
self.depends_raw = trace.targets[self.cmake_name].depends

rtgt = resolve_cmake_trace_targets(self.cmake_name, trace, self.env)
rtgt = resolve_cmake_trace_targets(self.cmake_name, trace, self.env, clib_compiler=self.clib_compiler)
self.includes += [Path(x) for x in rtgt.include_directories]
self.link_flags += rtgt.link_flags
self.public_link_flags += rtgt.public_link_flags
Expand Down

0 comments on commit 35dc1ec

Please sign in to comment.