aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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)