diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2020-07-24 15:23:05 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2020-07-28 19:51:58 +0200 |
commit | 1123f4f311e1ac89b341dea2cb5922f29dc502e3 (patch) | |
tree | 6ec5a6a45c9a7a209581d1e4e8168943ff3fba96 | |
parent | 3dea817a597e4d2f10bfe3c1e006a0983555ad15 (diff) | |
download | meson-1123f4f311e1ac89b341dea2cb5922f29dc502e3.zip meson-1123f4f311e1ac89b341dea2cb5922f29dc502e3.tar.gz meson-1123f4f311e1ac89b341dea2cb5922f29dc502e3.tar.bz2 |
Avoid warning about multiple outputs when building private directory name
Fixup for b4b1a2c5a145c1459fc4563a289e164e23bd6a02.
A warning would be printed for any rule with multiple outputs, for
example:
WARNING: custom_target 'coredump.conf.5' has more than one output! Using the first one.
WARNING: custom_target 'dnssec-trust-anchors.d.5' has more than one output! Using the first one.
WARNING: custom_target 'halt.8' has more than one output! Using the first one.
Fixes https://github.com/systemd/systemd/issues/16461.
-rw-r--r-- | mesonbuild/backend/backends.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py index cfd3a39..effd222 100644 --- a/mesonbuild/backend/backends.py +++ b/mesonbuild/backend/backends.py @@ -183,9 +183,9 @@ class Backend: self.build_to_src = mesonlib.relpath(self.environment.get_source_dir(), self.environment.get_build_dir()) - def get_target_filename(self, t): + def get_target_filename(self, t, *, warn_multi_output: bool = True): if isinstance(t, build.CustomTarget): - if len(t.get_outputs()) != 1: + if warn_multi_output and len(t.get_outputs()) != 1: mlog.warning('custom_target {!r} has more than one output! ' 'Using the first one.'.format(t.name)) filename = t.get_outputs()[0] @@ -261,7 +261,7 @@ class Backend: return self.build_to_src def get_target_private_dir(self, target): - return os.path.join(self.get_target_filename(target) + '.p') + return os.path.join(self.get_target_filename(target, warn_multi_output=False) + '.p') def get_target_private_dir_abs(self, target): return os.path.join(self.environment.get_build_dir(), self.get_target_private_dir(target)) |