diff options
author | Jakub Adam <jakub.adam@collabora.com> | 2019-03-28 12:12:33 +0100 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2019-03-28 23:20:21 +0200 |
commit | 0ad56708955eaef47fcf854bbb00e9a0e54536c0 (patch) | |
tree | 90c01593c5743bce347b4ca73fda81c6f807da03 /mesonbuild/interpreter.py | |
parent | 68567482f519918cbbf01c3010e62a4c75001631 (diff) | |
download | meson-0ad56708955eaef47fcf854bbb00e9a0e54536c0.zip meson-0ad56708955eaef47fcf854bbb00e9a0e54536c0.tar.gz meson-0ad56708955eaef47fcf854bbb00e9a0e54536c0.tar.bz2 |
Fix run_command() with command on a different drive
On Windows, program on a different drive than srcdir won't have
an expressible relative path; cmd_path will be absolute instead and
shouldn't get added into build_def_files.
Diffstat (limited to 'mesonbuild/interpreter.py')
-rw-r--r-- | mesonbuild/interpreter.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py index 3d91dc9..234b983 100644 --- a/mesonbuild/interpreter.py +++ b/mesonbuild/interpreter.py @@ -2335,8 +2335,12 @@ external dependencies (including libraries) must go to "dependencies".''') 'or not executable'.format(cmd)) cmd = prog cmd_path = mesonlib.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) + if not cmd_path.startswith('..'): + # On Windows, program on a different drive than srcdir won't have + # an expressible relative path; cmd_path will be absolute instead. + if not os.path.isabs(cmd_path): + if 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): |