diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2022-08-16 11:14:14 -0700 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2022-08-17 13:44:08 -0700 |
commit | 5ca5e0c900340110eb26bcf4491033e9d1bacf08 (patch) | |
tree | 36d7293d77b035b1b45699ae46a33f61e5240bcb /mesonbuild/build.py | |
parent | fd9ee31d148f8e7e8ead729bddc14eb3095779ce (diff) | |
download | meson-5ca5e0c900340110eb26bcf4491033e9d1bacf08.zip meson-5ca5e0c900340110eb26bcf4491033e9d1bacf08.tar.gz meson-5ca5e0c900340110eb26bcf4491033e9d1bacf08.tar.bz2 |
build: actually check for targets with no sources
Do to a bug in which a method, rather than an attribute, was checked
we would never detect that a target had no sources, even though we meant
to. As a result we would never actually error out when a target has no
sources. When fixing the check, I've changed the error to a warning
so that existing projects will continue to build without errors, only
warnings.
Diffstat (limited to 'mesonbuild/build.py')
-rw-r--r-- | mesonbuild/build.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py index 33d91f3..5882133 100644 --- a/mesonbuild/build.py +++ b/mesonbuild/build.py @@ -783,8 +783,10 @@ class BuildTarget(Target): self.process_objectlist(objects) self.process_kwargs(kwargs) self.check_unknown_kwargs(kwargs) - if not any([self.sources, self.generated, self.objects, self.link_whole, self.structured_sources]): - raise InvalidArguments(f'Build target {name} has no sources.') + if not any([self.sources, self.generated, self.objects, self.link_whole_targets, self.structured_sources]): + mlog.warning(f'Build target {name} has no sources. ' + 'This was never supposed to be allowed but did because of a bug, ' + 'support will be removed in a future release of Meson') self.validate_install() self.check_module_linking() |