diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2018-03-17 20:21:46 +0200 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2018-04-15 13:32:38 +0530 |
commit | 4256c0dae2e4793a486ef38eec4361639dbb2957 (patch) | |
tree | 31d627c164f943fc966b0f17c9fa95efe786e18e /mesonbuild | |
parent | bdb57cf62a56e292d3ebf9f4ba39be07674707f8 (diff) | |
download | meson-4256c0dae2e4793a486ef38eec4361639dbb2957.zip meson-4256c0dae2e4793a486ef38eec4361639dbb2957.tar.gz meson-4256c0dae2e4793a486ef38eec4361639dbb2957.tar.bz2 |
Can override programs with scripts generated with configure_file.
Diffstat (limited to 'mesonbuild')
-rw-r--r-- | mesonbuild/interpreter.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py index c958b6f..9d3a669 100644 --- a/mesonbuild/interpreter.py +++ b/mesonbuild/interpreter.py @@ -1426,6 +1426,12 @@ class MesonMain(InterpreterObject): raise InterpreterException('First argument must be a string') if hasattr(exe, 'held_object'): exe = exe.held_object + if isinstance(exe, mesonlib.File): + abspath = exe.absolute_path(self.interpreter.environment.source_dir, + self.interpreter.environment.build_dir) + if not os.path.exists(abspath): + raise InterpreterException('Tried to override %s with a file that does not exist.' % name) + exe = dependencies.ExternalProgram(abspath) if not isinstance(exe, dependencies.ExternalProgram): # FIXME, make this work if the exe is an Executable target. raise InterpreterException('Second argument must be an external program.') |