aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/environment.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2017-08-15 20:05:56 +0300
committerJussi Pakkanen <jpakkane@gmail.com>2017-09-13 23:05:11 +0300
commit40156e422a8810a5de1aae5d3b0728031c8777da (patch)
treecd4115cc0e2a77d8dfd8af1bff2bd3427f8e9f9c /mesonbuild/environment.py
parentf5d530ef714bcbe72640a88ee8db9a041d88ce15 (diff)
downloadmeson-0.42-msi.zip
meson-0.42-msi.tar.gz
meson-0.42-msi.tar.bz2
Make all functionality invokable via the main Meson binary,0.42-msi
which can be a Windows .exe file.
Diffstat (limited to 'mesonbuild/environment.py')
-rw-r--r--mesonbuild/environment.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py
index 379282e..0b2a159 100644
--- a/mesonbuild/environment.py
+++ b/mesonbuild/environment.py
@@ -19,6 +19,7 @@ from .linkers import ArLinker, VisualStudioLinker
from . import mesonlib
from .mesonlib import EnvironmentException, Popen_safe
from . import mlog
+import sys
from . import compilers
from .compilers import (
@@ -361,8 +362,15 @@ class Environment:
def get_coredata(self):
return self.coredata
- def get_build_command(self):
- return self.meson_script_launcher
+ def get_build_command(self, unbuffered=False):
+ # If running an executable created with cx_freeze,
+ # Python might not be installed so don't prefix
+ # the command with it.
+ if sys.executable.endswith('meson.exe'):
+ return [sys.executable]
+ if unbuffered:
+ [sys.executable, '-u', self.meson_script_launcher]
+ return [sys.executable, self.meson_script_launcher]
def is_header(self, fname):
return is_header(fname)