From 6d939c67370e2fc3f4d4607864ed4addbef22cb7 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Mon, 24 Jul 2017 13:44:43 -0700 Subject: Consider link_whole_targets when determining linker Currently if a target uses link_whole, and one of those archives is a C++, but the files for the target are C linking will fail when the C linker attempts to link the C++ files. This patches add link_whole_targets to the list of languages in the target so the correct linker will be selected. --- mesonbuild/build.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'mesonbuild/build.py') diff --git a/mesonbuild/build.py b/mesonbuild/build.py index 58cf987..94f177a 100644 --- a/mesonbuild/build.py +++ b/mesonbuild/build.py @@ -14,6 +14,7 @@ import copy, os, re from collections import OrderedDict +import itertools from . import environment from . import dependencies @@ -936,7 +937,7 @@ You probably should put it in link_with instead.''') langs.append(dep.language) # Check if any of the internal libraries this target links to were # written in this language - for link_target in self.link_targets: + for link_target in itertools.chain(self.link_targets, self.link_whole_targets): for language in link_target.compilers: if language not in langs: langs.append(language) -- cgit v1.1