aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/mesonlib.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2017-11-22 00:47:20 +0200
committerGitHub <noreply@github.com>2017-11-22 00:47:20 +0200
commitd882b6fbd466940d452cfaa890bd9270e10a93b4 (patch)
treed1ed9d893da50afb4ed3e6f031da91949f1d67ee /mesonbuild/mesonlib.py
parentfdb48a3a0f0425a6bd4a71a2e004479080955df8 (diff)
parentf9e88cd37e6babc1de476398f54a540f3eeca1c7 (diff)
downloadmeson-d882b6fbd466940d452cfaa890bd9270e10a93b4.zip
meson-d882b6fbd466940d452cfaa890bd9270e10a93b4.tar.gz
meson-d882b6fbd466940d452cfaa890bd9270e10a93b4.tar.bz2
Merge pull request #2498 from mesonbuild/runpython
Add possibility to run Python scripts with current interpreter
Diffstat (limited to 'mesonbuild/mesonlib.py')
-rw-r--r--mesonbuild/mesonlib.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/mesonbuild/mesonlib.py b/mesonbuild/mesonlib.py
index c8eea4d..e9cf6cf 100644
--- a/mesonbuild/mesonlib.py
+++ b/mesonbuild/mesonlib.py
@@ -22,6 +22,15 @@ import collections
from glob import glob
+if os.path.basename(sys.executable) == 'meson.exe':
+ # In Windows and using the MSI installed executable.
+ meson_command = [sys.executable]
+ python_command = [sys.executable, 'runpython']
+else:
+ meson_command = [sys.executable, os.path.join(os.path.dirname(__file__), '..', 'meson.py')]
+ python_command = [sys.executable]
+
+
# Put this in objects that should not get dumped to pickle files
# by accident.
import threading