diff options
-rw-r--r-- | mesonbuild/build.py | 3 | ||||
-rw-r--r-- | test cases/common/146 C and CPP link/meson.build | 12 |
2 files changed, 14 insertions, 1 deletions
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) diff --git a/test cases/common/146 C and CPP link/meson.build b/test cases/common/146 C and CPP link/meson.build index af40de7..db84445 100644 --- a/test cases/common/146 C and CPP link/meson.build +++ b/test cases/common/146 C and CPP link/meson.build @@ -60,3 +60,15 @@ libfoo = shared_library( ['foobar.c', 'foobar.h'], link_with : [libc, libcpp], ) + +# Test that link_whole is also honored +# +# VS2010 lacks the /WHOLEARCHIVE option that later versions of MSVC support, so +# don't run this tests on that backend. +if meson.backend() != 'vs2010' + libfoowhole = shared_library( + 'foowhole', + ['foobar.c', 'foobar.h'], + link_whole : [libc, libcpp], + ) +endif |