aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/mesonmain.py
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2018-08-10 16:05:07 +0530
committerNirbheek Chauhan <nirbheek@centricular.com>2018-08-11 03:19:57 +0530
commit2ee28029f945d74d01e63d6efd8802c9df03b28f (patch)
tree8fb6554f12650e2a9043bf108a320ec7f6681ed2 /mesonbuild/mesonmain.py
parent9f5c84279e65b70865d873999205012f2a2b859e (diff)
downloadmeson-2ee28029f945d74d01e63d6efd8802c9df03b28f.zip
meson-2ee28029f945d74d01e63d6efd8802c9df03b28f.tar.gz
meson-2ee28029f945d74d01e63d6efd8802c9df03b28f.tar.bz2
Install meson.exe as the entrypoint on Windows
Thanks to Rafael Rivera for the suggestion Fixes https://github.com/mesonbuild/meson/issues/1877
Diffstat (limited to 'mesonbuild/mesonmain.py')
-rw-r--r--mesonbuild/mesonmain.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/mesonbuild/mesonmain.py b/mesonbuild/mesonmain.py
index 011ac14..68a2ddb 100644
--- a/mesonbuild/mesonmain.py
+++ b/mesonbuild/mesonmain.py
@@ -232,15 +232,17 @@ def run_script_command(args):
return cmdfunc(cmdargs)
def set_meson_command(mainfile):
- if mainfile.endswith('.exe'):
+ # On UNIX-like systems `meson` is a Python script
+ # On Windows `meson` and `meson.exe` are wrapper exes
+ if not mainfile.endswith('.py'):
mesonlib.meson_command = [mainfile]
elif os.path.isabs(mainfile) and mainfile.endswith('mesonmain.py'):
# Can't actually run meson with an absolute path to mesonmain.py, it must be run as -m mesonbuild.mesonmain
mesonlib.meson_command = mesonlib.python_command + ['-m', 'mesonbuild.mesonmain']
else:
+ # Either run uninstalled, or full path to meson-script.py
mesonlib.meson_command = mesonlib.python_command + [mainfile]
- # This won't go into the log file because it's not initialized yet, and we
- # need this value for unit tests.
+ # We print this value for unit tests.
if 'MESON_COMMAND_TESTS' in os.environ:
mlog.log('meson_command is {!r}'.format(mesonlib.meson_command))