aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Behle <behlec@gmail.com>2018-07-02 20:28:29 +0200
committerChristoph Behle <behlec@gmail.com>2018-07-07 21:20:23 +0200
commit2d5e1e24a12791aa18631185b30e0ec55ae2bed6 (patch)
treeccce9c09780b0d06f5c76c178c2b871341fc063f
parent620c0b07a9bd93929590b88cf9c84026bc9ca1cd (diff)
downloadmeson-2d5e1e24a12791aa18631185b30e0ec55ae2bed6.zip
meson-2d5e1e24a12791aa18631185b30e0ec55ae2bed6.tar.gz
meson-2d5e1e24a12791aa18631185b30e0ec55ae2bed6.tar.bz2
Consider subdir for output files.
Files will only clash if in the same subdir. Print the subdir in the warning.
-rw-r--r--mesonbuild/interpreter.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py
index e28674e..a882e11 100644
--- a/mesonbuild/interpreter.py
+++ b/mesonbuild/interpreter.py
@@ -3448,12 +3448,16 @@ root and issuing %s.
raise InterpreterException('@INPUT@ used as command argument, but no input file specified.')
# Validate output
output = kwargs['output']
+ ofile_rpath = os.path.join(self.subdir, 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. First time written in line', self.configure_file_outputs[output], 'now in line', self.current_lineno)
+ if ofile_rpath in self.configure_file_outputs:
+ if len(self.subdir) > 0:
+ mlog.warning('Output file', mlog.bold(ofile_rpath), 'for configure_file overwritten. First time written in subdir', self.subdir, 'line', self.configure_file_outputs[ofile_rpath], 'now in line', self.current_lineno)
+ else:
+ mlog.warning('Output file', mlog.bold(ofile_rpath), 'for configure_file overwritten. First time written in line', self.configure_file_outputs[ofile_rpath], 'now in line', self.current_lineno)
else:
- self.configure_file_outputs[output] = self.current_lineno
+ self.configure_file_outputs[ofile_rpath] = self.current_lineno
if ifile_abs:
values = mesonlib.get_filenames_templates_dict([ifile_abs], None)
outputs = mesonlib.substitute_values([output], values)