diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2018-08-12 00:44:10 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-12 00:44:10 +0300 |
commit | f335c8bdeb0bf7631f916015c99ee376219ba3ca (patch) | |
tree | 1ea93a87e380db16c6587b264e0f3d102516d40c /mesonbuild/mesonmain.py | |
parent | d742e2e891b5a56558dd0eb9408c649585af6c89 (diff) | |
parent | c0413f5d49ce7b7df03cf859841aa8b275a6cd6d (diff) | |
download | meson-f335c8bdeb0bf7631f916015c99ee376219ba3ca.zip meson-f335c8bdeb0bf7631f916015c99ee376219ba3ca.tar.gz meson-f335c8bdeb0bf7631f916015c99ee376219ba3ca.tar.bz2 |
Merge pull request #4004 from mesonbuild/nirbheek/console-entrypoint
Install meson.exe as the entrypoint on Windows
Diffstat (limited to 'mesonbuild/mesonmain.py')
-rw-r--r-- | mesonbuild/mesonmain.py | 8 |
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)) |