mcompile: Add --verbose mode

Closes: https://github.com/mesonbuild/meson/issues/7352
Signed-off-by: Igor Raits <i.gnatenko.brain@gmail.com>
pull/7183/head
Igor Raits 4 years ago committed by Jussi Pakkanen
parent e353b2e8d4
commit d6c6b933c4
  1. 1
      data/macros.meson
  2. 2
      docs/markdown/Commands.md
  3. 5
      docs/markdown/Release-notes-for-0.54.0.md
  4. 11
      mesonbuild/mcompile.py

@ -28,6 +28,7 @@
%{shrink:%{__meson} compile \ %{shrink:%{__meson} compile \
-C %{_vpath_builddir} \ -C %{_vpath_builddir} \
-j %{_smp_build_ncpus} \ -j %{_smp_build_ncpus} \
--verbose \
%{nil}} %{nil}}
%meson_install \ %meson_install \

@ -137,6 +137,7 @@ meson configure builddir -Doption=new_value
``` ```
$ meson compile [-h] [-j JOBS] [-l LOAD_AVERAGE] [--clean] [-C BUILDDIR] $ meson compile [-h] [-j JOBS] [-l LOAD_AVERAGE] [--clean] [-C BUILDDIR]
[--verbose]
``` ```
Builds a default or a specified target of a configured meson project. Builds a default or a specified target of a configured meson project.
@ -153,6 +154,7 @@ optional arguments:
--clean Clean the build directory. --clean Clean the build directory.
-C BUILDDIR The directory containing build files to -C BUILDDIR The directory containing build files to
be built. be built.
--verbose Show more verbose output.
``` ```
#### Examples: #### Examples:

@ -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 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. 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).

@ -54,6 +54,8 @@ def get_parsed_args_ninja(options: 'argparse.Namespace', builddir: Path):
cmd.extend(['-j', str(options.jobs)]) cmd.extend(['-j', str(options.jobs)])
if options.load_average > 0: if options.load_average > 0:
cmd.extend(['-l', str(options.load_average)]) cmd.extend(['-l', str(options.load_average)])
if options.verbose:
cmd.append('-v')
if options.clean: if options.clean:
cmd.append('clean') cmd.append('clean')
@ -74,8 +76,10 @@ def get_parsed_args_vs(options: 'argparse.Namespace', builddir: Path):
if options.load_average: if options.load_average:
mlog.warning('Msbuild does not have a load-average switch, ignoring.') mlog.warning('Msbuild does not have a load-average switch, ignoring.')
if not options.verbose:
cmd.append('/v:minimal')
if options.clean: if options.clean:
cmd.extend(['/t:Clean']) cmd.append('/t:Clean')
return cmd return cmd
@ -108,6 +112,11 @@ def add_arguments(parser: 'argparse.ArgumentParser') -> None:
default='.', default='.',
help='The directory containing build files to be built.' 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: def run(options: 'argparse.Namespace') -> int:

Loading…
Cancel
Save