aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/dependencies.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2017-01-28 19:05:54 +0200
committerGitHub <noreply@github.com>2017-01-28 19:05:54 +0200
commit4a08841331cf0bb281ff5fa37ac106b539423140 (patch)
treeb9f14dbee8c924d8910af2b8607dee438f6ee779 /mesonbuild/dependencies.py
parent6357ad0cd051d56deeb6c029a436b47b1f5216ae (diff)
parent534ee8baa8b807b2adf52937a4672897f1a6d8cb (diff)
downloadmeson-4a08841331cf0bb281ff5fa37ac106b539423140.zip
meson-4a08841331cf0bb281ff5fa37ac106b539423140.tar.gz
meson-4a08841331cf0bb281ff5fa37ac106b539423140.tar.bz2
Merge pull request #1335 from tp-m/test-custom-target-used-in-test-cmd
tests: check custom target output is created before being used in a t…
Diffstat (limited to 'mesonbuild/dependencies.py')
-rw-r--r--mesonbuild/dependencies.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/mesonbuild/dependencies.py b/mesonbuild/dependencies.py
index b01e0a8..5ccc391 100644
--- a/mesonbuild/dependencies.py
+++ b/mesonbuild/dependencies.py
@@ -20,6 +20,7 @@
# package before this gets too big.
import re
+import sys
import os, stat, glob, shutil
import subprocess
import sysconfig
@@ -426,10 +427,15 @@ class ExternalProgram:
if first_line.startswith('#!'):
commands = first_line[2:].split('#')[0].strip().split()
if mesonlib.is_windows():
- # Windows does not have /usr/bin.
- commands[0] = commands[0].split('/')[-1]
- if commands[0] == 'env':
+ # Windows does not have UNIX paths so remove them,
+ # but don't remove Windows paths
+ if commands[0].startswith('/'):
+ commands[0] = commands[0].split('/')[-1]
+ if len(commands) > 0 and commands[0] == 'env':
commands = commands[1:]
+ # Windows does not ship python3.exe, but we know the path to it
+ if len(commands) > 0 and commands[0] == 'python3':
+ commands[0] = sys.executable
return commands + [script]
except Exception:
pass