diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2015-08-26 00:19:22 +0300 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2015-08-26 00:19:34 +0300 |
commit | 11985b71b4b87a71d40883a5d1f391602367b55f (patch) | |
tree | 0898dd7dda2cf21eab4dd1e62960fd033f004337 | |
parent | 44fa1ee86be848ce742629f7db5b4738b7b75c54 (diff) | |
download | meson-11985b71b4b87a71d40883a5d1f391602367b55f.zip meson-11985b71b4b87a71d40883a5d1f391602367b55f.tar.gz meson-11985b71b4b87a71d40883a5d1f391602367b55f.tar.bz2 |
Detect Python bin properly when under msys2.
-rw-r--r-- | ninjabackend.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/ninjabackend.py b/ninjabackend.py index b0419de..e4e8a62 100644 --- a/ninjabackend.py +++ b/ninjabackend.py @@ -370,6 +370,12 @@ class NinjaBackend(backends.Backend): if not added_rule: mlog.log(mlog.red('Warning:'), 'coverage requested but neither gcovr nor lcov/genhtml found.') + def detect_pythonbin(self): + # Under msys2 Python lies about where sys.executable is. + if 'MSYSTEM' in os.environ: + return os.path.join(os.environ['WD'], 'python3') + return sys.executable + def generate_install(self, outfile): script_root = self.environment.get_script_dir() install_script = os.path.join(script_root, 'meson_install.py') @@ -381,7 +387,7 @@ class NinjaBackend(backends.Backend): elem = NinjaBuildElement('install', 'CUSTOM_COMMAND', '') elem.add_dep('all') elem.add_item('DESC', 'Installing files.') - elem.add_item('COMMAND', [sys.executable, install_script, install_data_file]) + elem.add_item('COMMAND', [self.detect_pythonbin(), install_script, install_data_file]) elem.add_item('pool', 'console') self.generate_depmf_install(d) self.generate_target_install(d) |