aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2017-09-12 14:53:19 -0700
committerDylan Baker <dylan@pnwbakers.com>2017-09-21 12:10:59 -0700
commitd070100c8c0529db984b4cb10de745e762b9199a (patch)
tree13d57ae47031360901ce56d687b483aff9a4643b
parent2f6702839e9f1c109230ace33e997b4d06663479 (diff)
downloadmeson-d070100c8c0529db984b4cb10de745e762b9199a.zip
meson-d070100c8c0529db984b4cb10de745e762b9199a.tar.gz
meson-d070100c8c0529db984b4cb10de745e762b9199a.tar.bz2
link_whole should be considered a source for targets
Currently sources, generated sources, or objects are considered to be sources for a target, but link_whole should also fulfill the sources requirement. Fixes #2180
-rw-r--r--mesonbuild/build.py2
-rw-r--r--test cases/common/145 whole archive/meson.build7
2 files changed, 8 insertions, 1 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py
index c54abbd..5740fbb 100644
--- a/mesonbuild/build.py
+++ b/mesonbuild/build.py
@@ -357,7 +357,7 @@ class BuildTarget(Target):
self.process_compilers()
self.process_kwargs(kwargs, environment)
self.check_unknown_kwargs(kwargs)
- if not self.sources and not self.generated and not self.objects:
+ if not any([self.sources, self.generated, self.objects, self.link_whole]):
raise InvalidArguments('Build target %s has no sources.' % name)
self.process_compilers_late()
self.validate_sources()
diff --git a/test cases/common/145 whole archive/meson.build b/test cases/common/145 whole archive/meson.build
index eadebf8..6689c3c 100644
--- a/test cases/common/145 whole archive/meson.build
+++ b/test cases/common/145 whole archive/meson.build
@@ -20,3 +20,10 @@ exe = executable('prog', 'prog.c',
test('prog', exe)
+# link_whole only
+static = static_library('static', 'dylib.c')
+dylib2 = shared_library('link_whole', link_whole : [stlib, static])
+
+exe2 = executable('prog2', 'prog.c', link_with : dylib2)
+
+test('prog2', exe2)