diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2018-02-12 21:23:12 +0200 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2018-02-13 21:28:42 +0200 |
commit | ca4cbab004b9ce5ad10a2f73583de040368859bb (patch) | |
tree | 916ec06e1148baa01ab029a11d28e6552f9fd84b /mesonbuild/interpreter.py | |
parent | a99ae8104384210255887b2fd8094bb137c98ea0 (diff) | |
download | meson-ca4cbab004b9ce5ad10a2f73583de040368859bb.zip meson-ca4cbab004b9ce5ad10a2f73583de040368859bb.tar.gz meson-ca4cbab004b9ce5ad10a2f73583de040368859bb.tar.bz2 |
Use absolute path if relative can not be evaluated. Closes #2784.
Diffstat (limited to 'mesonbuild/interpreter.py')
-rw-r--r-- | mesonbuild/interpreter.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py index 31d7616..b838f28 100644 --- a/mesonbuild/interpreter.py +++ b/mesonbuild/interpreter.py @@ -1684,7 +1684,14 @@ 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) + try: + cmd_path = os.path.relpath(cmd.get_path(), start=srcdir) + except ValueError: + # On Windows a relative path can't be evaluated for + # paths on two different drives (i.e. c:\foo and f:\bar). + # The only thing left to is is to use the original absolute + # path. + cmd_path = cmd.get_path() if not cmd_path.startswith('..') and cmd_path not in self.build_def_files: self.build_def_files.append(cmd_path) expanded_args = [] |