From: Matt Turner <mattst88@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Cc: floppym@gentoo.org, mgorny@gentoo.org, base-system@gentoo.org,
kde@gentoo.org, Matt Turner <mattst88@gentoo.org>
Subject: [gentoo-dev] [PATCH 1/2] ninja-utils.eclass: Add NINJA_VERBOSE
Date: Mon, 17 Jul 2023 11:21:22 -0400 [thread overview]
Message-ID: <20230717152123.1467096-1-mattst88@gentoo.org> (raw)
ninja operates in one of three modes:
- verbose (with -v): prints build commands
- quiet (with --quiet): prints nothing
- normal: prints [XX/YY]-style build status updates
samurai works the same way, except it does not have a quiet mode.
Thus we can't simply override ninja-utils' hard-coded flag from callers
of eninja.
Signed-off-by: Matt Turner <mattst88@gentoo.org>
---
eclass/ninja-utils.eclass | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/eclass/ninja-utils.eclass b/eclass/ninja-utils.eclass
index e6d8c9e6c0a9..26ba31678f01 100644
--- a/eclass/ninja-utils.eclass
+++ b/eclass/ninja-utils.eclass
@@ -48,6 +48,12 @@ _NINJA_UTILS_ECLASS=1
# supposed to be set in make.conf. If unset, eninja() will convert
# MAKEOPTS instead.
+# @ECLASS_VARIABLE: NINJA_VERBOSE
+# @USER_VARIABLE
+# @DESCRIPTION:
+# Set to OFF to disable verbose messages during compilation
+: "${NINJA_VERBOSE:=ON}"
+
inherit multiprocessing
case "${NINJA}" in
@@ -80,7 +86,12 @@ get_NINJAOPTS() {
# also supports being called via 'nonfatal'.
eninja() {
[[ -n "${NINJA_DEPEND}" ]] || ewarn "Unknown value '${NINJA}' for \${NINJA}"
- set -- "${NINJA}" -v $(get_NINJAOPTS) "$@"
+ local v
+ case "${NINJA_VERBOSE}" in
+ OFF) ;;
+ *) v="-v"
+ esac
+ set -- "${NINJA}" ${v} $(get_NINJAOPTS) "$@"
echo "$@" >&2
"$@" || die -n "${*} failed"
}
--
2.41.0
next reply other threads:[~2023-07-17 15:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-17 15:21 Matt Turner [this message]
2023-07-17 15:21 ` [gentoo-dev] [PATCH 2/2] cmake.eclass: Support CMAKE_VERBOSE with ninja Matt Turner
2023-07-18 17:31 ` [gentoo-dev] [PATCH 1/2] ninja-utils.eclass: Add NINJA_VERBOSE Mike Gilbert
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230717152123.1467096-1-mattst88@gentoo.org \
--to=mattst88@gentoo.org \
--cc=base-system@gentoo.org \
--cc=floppym@gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
--cc=kde@gentoo.org \
--cc=mgorny@gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox