From c7ddde58fd4a57e30fbbd4a9e9c4799b65f3e876 Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Mon, 22 Feb 2021 20:11:10 -0500 Subject: [PATCH] mcompile: do not pass the builddir to ninja if it is the current directory Because when you don't specify -C, this logging feels silly: ninja: Entering directory `. --- mesonbuild/mcompile.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mesonbuild/mcompile.py b/mesonbuild/mcompile.py index b623dbe95..ba1d3cfe0 100644 --- a/mesonbuild/mcompile.py +++ b/mesonbuild/mcompile.py @@ -142,7 +142,9 @@ def get_parsed_args_ninja(options: 'argparse.Namespace', builddir: Path) -> T.Tu if runner is None: raise MesonException('Cannot find ninja.') - cmd = runner + ['-C', builddir.as_posix()] + cmd = runner + if not builddir.samefile('.'): + cmd.extend(['-C', builddir.as_posix()]) # If the value is set to < 1 then don't set anything, which let's # ninja/samu decide what to do.