commit: 89fa08dd8703bfd854d6a77a60bbd270ae8d803d Author: Jonas Rakebrandt <xarblu <AT> protonmail <DOT> com> AuthorDate: Mon Jan 2 19:40:13 2023 +0000 Commit: Matt Turner <mattst88 <AT> gentoo <DOT> org> CommitDate: Tue Jul 18 20:51:54 2023 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=89fa08dd
meson.eclass: Add MESON_VERBOSE This works similar to cmake.eclass's ${CMAKE_VERBOSE}. Closes: https://github.com/gentoo/gentoo/pull/28942 Signed-off-by: Jonas Rakebrandt <xarblu <AT> protonmail.com> Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org> eclass/meson.eclass | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/eclass/meson.eclass b/eclass/meson.eclass index adbc495fdef3..5aff3eb58930 100644 --- a/eclass/meson.eclass +++ b/eclass/meson.eclass @@ -54,6 +54,12 @@ BDEPEND=">=dev-util/meson-0.62.2 # Build directory, location where all generated files should be placed. # If this isn't set, it defaults to ${WORKDIR}/${P}-build. +# @ECLASS_VARIABLE: MESON_VERBOSE +# @USER_VARIABLE +# @DESCRIPTION: +# Set to OFF to disable verbose messages during compilation +: "${MESON_VERBOSE:=ON}" + # @ECLASS_VARIABLE: EMESON_BUILDTYPE # @DESCRIPTION: # The buildtype value to pass to meson setup. @@ -384,10 +390,15 @@ meson_src_compile() { -C "${BUILD_DIR}" --jobs "$(makeopts_jobs "${MAKEOPTS}" 0)" --load-average "$(makeopts_loadavg "${MAKEOPTS}" 0)" - --verbose - "$@" ) + case ${MESON_VERBOSE} in + OFF) ;; + *) mesoncompileargs+=( --verbose ) ;; + esac + + mesoncompileargs+=( "$@" ) + set -- meson compile "${mesoncompileargs[@]}" echo "$@" >&2 "$@" || die "compile failed"