diff options
author | Scott D Phillips <scott.d.phillips@intel.com> | 2017-10-13 16:13:09 -0700 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2017-10-29 18:43:17 +0200 |
commit | 1b0048a7022a89f461cf4d01e7cdbf995bab70f5 (patch) | |
tree | 8e8e28e009426ea8314e01d49dff6d3033e6e1cb /mesonbuild/interpreter.py | |
parent | 01611a66e268a3cda7938fe99456ed78f83c73b2 (diff) | |
download | meson-1b0048a7022a89f461cf4d01e7cdbf995bab70f5.zip meson-1b0048a7022a89f461cf4d01e7cdbf995bab70f5.tar.gz meson-1b0048a7022a89f461cf4d01e7cdbf995bab70f5.tar.bz2 |
run_command: add command and files as build dependencies
Diffstat (limited to 'mesonbuild/interpreter.py')
-rw-r--r-- | mesonbuild/interpreter.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py index 727c688..dd23070 100644 --- a/mesonbuild/interpreter.py +++ b/mesonbuild/interpreter.py @@ -1638,6 +1638,9 @@ external dependencies (including libraries) must go to "dependencies".''') raise InterpreterException('Program or command {!r} not found' 'or not executable'.format(cmd)) cmd = prog + cmd_path = os.path.relpath(cmd.get_path(), start=srcdir) + if not cmd_path.startswith('..') and cmd_path not in self.build_def_files: + self.build_def_files.append(cmd_path) expanded_args = [] for a in listify(cargs): if isinstance(a, str): @@ -1648,6 +1651,14 @@ external dependencies (including libraries) must go to "dependencies".''') expanded_args.append(a.held_object.get_path()) else: raise InterpreterException('Arguments ' + m.format(a)) + for a in expanded_args: + if not os.path.isabs(a): + a = os.path.join(builddir if in_builddir else srcdir, self.subdir, a) + if os.path.exists(a): + a = os.path.relpath(a, start=srcdir) + if not a.startswith('..'): + if a not in self.build_def_files: + self.build_def_files.append(a) return RunProcess(cmd, expanded_args, srcdir, builddir, self.subdir, self.environment.get_build_command() + ['introspect'], in_builddir) |