From d6c6b933c464d2689751da4f78cdd6463a4bc041 Mon Sep 17 00:00:00 2001 From: Igor Raits Date: Thu, 18 Jun 2020 16:45:27 +0200 Subject: [PATCH] mcompile: Add --verbose mode Closes: https://github.com/mesonbuild/meson/issues/7352 Signed-off-by: Igor Raits --- data/macros.meson | 1 + docs/markdown/Commands.md | 2 ++ docs/markdown/Release-notes-for-0.54.0.md | 5 +++++ mesonbuild/mcompile.py | 11 ++++++++++- 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/data/macros.meson b/data/macros.meson index 8a66c9657..cc4953c5f 100644 --- a/data/macros.meson +++ b/data/macros.meson @@ -28,6 +28,7 @@ %{shrink:%{__meson} compile \ -C %{_vpath_builddir} \ -j %{_smp_build_ncpus} \ + --verbose \ %{nil}} %meson_install \ diff --git a/docs/markdown/Commands.md b/docs/markdown/Commands.md index 615b30224..dbcfee4f6 100644 --- a/docs/markdown/Commands.md +++ b/docs/markdown/Commands.md @@ -137,6 +137,7 @@ meson configure builddir -Doption=new_value ``` $ meson compile [-h] [-j JOBS] [-l LOAD_AVERAGE] [--clean] [-C BUILDDIR] + [--verbose] ``` Builds a default or a specified target of a configured meson project. @@ -153,6 +154,7 @@ optional arguments: --clean Clean the build directory. -C BUILDDIR The directory containing build files to be built. + --verbose Show more verbose output. ``` #### Examples: diff --git a/docs/markdown/Release-notes-for-0.54.0.md b/docs/markdown/Release-notes-for-0.54.0.md index 3202b5712..2f215de47 100644 --- a/docs/markdown/Release-notes-for-0.54.0.md +++ b/docs/markdown/Release-notes-for-0.54.0.md @@ -359,3 +359,8 @@ target that has eight source files, Meson will generate two unity files each of which includes four source files. The old behaviour can be replicated by setting `unity_size` to a large value, such as 10000. +## Verbose mode for `meson compile` + +The new option `--verbose` has been added to `meson compile` that will enable +more verbose compilation logs. Note that for VS backend it means that logs will +be less verbose by default (without `--verbose` option). diff --git a/mesonbuild/mcompile.py b/mesonbuild/mcompile.py index e4576239b..0bcb56ec3 100644 --- a/mesonbuild/mcompile.py +++ b/mesonbuild/mcompile.py @@ -54,6 +54,8 @@ def get_parsed_args_ninja(options: 'argparse.Namespace', builddir: Path): cmd.extend(['-j', str(options.jobs)]) if options.load_average > 0: cmd.extend(['-l', str(options.load_average)]) + if options.verbose: + cmd.append('-v') if options.clean: cmd.append('clean') @@ -74,8 +76,10 @@ def get_parsed_args_vs(options: 'argparse.Namespace', builddir: Path): if options.load_average: mlog.warning('Msbuild does not have a load-average switch, ignoring.') + if not options.verbose: + cmd.append('/v:minimal') if options.clean: - cmd.extend(['/t:Clean']) + cmd.append('/t:Clean') return cmd @@ -108,6 +112,11 @@ def add_arguments(parser: 'argparse.ArgumentParser') -> None: default='.', help='The directory containing build files to be built.' ) + parser.add_argument( + '--verbose', + action='store_true', + help='Show more verbose output.' + ) def run(options: 'argparse.Namespace') -> int: