diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2018-07-09 21:16:11 +0300 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2018-07-09 23:14:59 +0200 |
commit | 09ad29ec560f2a05108694d909de30b5e3e58357 (patch) | |
tree | 2e39442dfcd8c1d58ab36378c2720bd193bec009 /mesonbuild/mesonmain.py | |
parent | 8cfb8fd02c86e1667ded9a7841d77204f96a4a6d (diff) | |
download | meson-09ad29ec560f2a05108694d909de30b5e3e58357.zip meson-09ad29ec560f2a05108694d909de30b5e3e58357.tar.gz meson-09ad29ec560f2a05108694d909de30b5e3e58357.tar.bz2 |
Fix directory verification. Closes #3857.
Diffstat (limited to 'mesonbuild/mesonmain.py')
-rw-r--r-- | mesonbuild/mesonmain.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/mesonbuild/mesonmain.py b/mesonbuild/mesonmain.py index 1aca9c6..011ac14 100644 --- a/mesonbuild/mesonmain.py +++ b/mesonbuild/mesonmain.py @@ -41,8 +41,8 @@ def create_parser(): help='Special wrap mode to use') p.add_argument('--profile-self', action='store_true', dest='profile', help=argparse.SUPPRESS) - p.add_argument('builddir', nargs='?', default='..') - p.add_argument('sourcedir', nargs='?', default='.') + p.add_argument('builddir', nargs='?', default=None) + p.add_argument('sourcedir', nargs='?', default=None) return p def wrapmodetype(string): @@ -331,6 +331,15 @@ def run(original_args, mainfile): dir1 = options.builddir dir2 = options.sourcedir try: + if dir1 is None: + if dir2 is None: + if not os.path.exists('meson.build') and os.path.exists('../meson.build'): + dir2 = '..' + else: + raise MesonException('Must specify at least one directory name.') + dir1 = os.getcwd() + if dir2 is None: + dir2 = os.getcwd() app = MesonApp(dir1, dir2, handshake, options) except Exception as e: # Log directory does not exist, so just print |