diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2017-08-15 20:05:56 +0300 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2017-08-18 12:08:20 +0300 |
commit | 50fb7d37abc02b674b66071b51b1a2862fabb3cd (patch) | |
tree | d75a57c8f0726f772219979e00b624832038a01a /mesonbuild/environment.py | |
parent | 62aabb5a8be90467603b1348d8ae4c0847bc5d1e (diff) | |
download | meson-50fb7d37abc02b674b66071b51b1a2862fabb3cd.zip meson-50fb7d37abc02b674b66071b51b1a2862fabb3cd.tar.gz meson-50fb7d37abc02b674b66071b51b1a2862fabb3cd.tar.bz2 |
Make all functionality invokable via the main Meson binary,
which can be a Windows .exe file.
Diffstat (limited to 'mesonbuild/environment.py')
-rw-r--r-- | mesonbuild/environment.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py index d4af9be..1405c06 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) |