public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [PATCH 1/2] ninja-utils.eclass: Add NINJA_VERBOSE
@ 2023-07-17 15:21 Matt Turner
  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
  0 siblings, 2 replies; 3+ messages in thread
From: Matt Turner @ 2023-07-17 15:21 UTC (permalink / raw
  To: gentoo-dev; +Cc: floppym, mgorny, base-system, kde, Matt Turner

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



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-dev] [PATCH 2/2] cmake.eclass: Support CMAKE_VERBOSE with ninja
  2023-07-17 15:21 [gentoo-dev] [PATCH 1/2] ninja-utils.eclass: Add NINJA_VERBOSE Matt Turner
@ 2023-07-17 15:21 ` Matt Turner
  2023-07-18 17:31 ` [gentoo-dev] [PATCH 1/2] ninja-utils.eclass: Add NINJA_VERBOSE Mike Gilbert
  1 sibling, 0 replies; 3+ messages in thread
From: Matt Turner @ 2023-07-17 15:21 UTC (permalink / raw
  To: gentoo-dev; +Cc: floppym, mgorny, base-system, kde, Matt Turner

Signed-off-by: Matt Turner <mattst88@gentoo.org>
---
 eclass/cmake.eclass | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/eclass/cmake.eclass b/eclass/cmake.eclass
index d70f2cbf1fac..16b3e300ccae 100644
--- a/eclass/cmake.eclass
+++ b/eclass/cmake.eclass
@@ -651,6 +651,10 @@ cmake_build() {
 			;;
 		ninja)
 			[[ -e build.ninja ]] || die "build.ninja not found. Error during configure stage."
+			case ${CMAKE_VERBOSE} in
+				OFF) NINJA_VERBOSE=OFF eninja "$@" ;;
+				*) eninja "$@" ;;
+			esac
 			eninja "$@"
 			;;
 	esac
-- 
2.41.0



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [gentoo-dev] [PATCH 1/2] ninja-utils.eclass: Add NINJA_VERBOSE
  2023-07-17 15:21 [gentoo-dev] [PATCH 1/2] ninja-utils.eclass: Add NINJA_VERBOSE Matt Turner
  2023-07-17 15:21 ` [gentoo-dev] [PATCH 2/2] cmake.eclass: Support CMAKE_VERBOSE with ninja Matt Turner
@ 2023-07-18 17:31 ` Mike Gilbert
  1 sibling, 0 replies; 3+ messages in thread
From: Mike Gilbert @ 2023-07-18 17:31 UTC (permalink / raw
  To: gentoo-dev; +Cc: mgorny, base-system, kde, Matt Turner

On Mon, Jul 17, 2023 at 11:21 AM Matt Turner <mattst88@gentoo.org> wrote:
>
> 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.

Seems ok to me.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-07-18 17:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-17 15:21 [gentoo-dev] [PATCH 1/2] ninja-utils.eclass: Add NINJA_VERBOSE Matt Turner
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox