diff options
author | Christoph Behle <behlec@gmail.com> | 2018-06-30 19:02:26 +0200 |
---|---|---|
committer | Christoph Behle <behlec@gmail.com> | 2018-07-07 21:20:23 +0200 |
commit | 07f5a5e4901c3c5afde15b305df72a0d09f5af72 (patch) | |
tree | 23e3dcfc16e4cfa747c401b4bd34cef767d1a2e4 /mesonbuild/interpreter.py | |
parent | 2093d45a4e1203d868d200628918472877c7ec31 (diff) | |
download | meson-07f5a5e4901c3c5afde15b305df72a0d09f5af72.zip meson-07f5a5e4901c3c5afde15b305df72a0d09f5af72.tar.gz meson-07f5a5e4901c3c5afde15b305df72a0d09f5af72.tar.bz2 |
Add warning if configure_file overwrites output.
Record the output for each call to configure_file.
If a previous output is overwritten print a warning.
Diffstat (limited to 'mesonbuild/interpreter.py')
-rw-r--r-- | mesonbuild/interpreter.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py index 833e982..0974691 100644 --- a/mesonbuild/interpreter.py +++ b/mesonbuild/interpreter.py @@ -1862,6 +1862,7 @@ class Interpreter(InterpreterBase): self.global_args_frozen = False # implies self.project_args_frozen self.subprojects = {} self.subproject_stack = [] + self.configure_file_outputs = {} # Passed from the outside, only used in subprojects. if default_project_options: self.default_project_options = default_project_options.copy() @@ -3449,6 +3450,10 @@ root and issuing %s. output = kwargs['output'] if not isinstance(output, str): raise InterpreterException('Output file name must be a string') + if output in self.configure_file_outputs: + mlog.warning('Output file', mlog.bold(output), 'for configure_file overwritten.') + else: + self.configure_file_outputs[output] = None if ifile_abs: values = mesonlib.get_filenames_templates_dict([ifile_abs], None) outputs = mesonlib.substitute_values([output], values) |