From 329f81b55286f9a72341b2402078fc4f0c46c8f9 Mon Sep 17 00:00:00 2001 From: "Anna (cybertailor) Vyalkova" Date: Sat, 16 Jul 2022 12:26:33 +0500 Subject: [PATCH] nim-utils.eclass: beautify NOCOLOR stuff Signed-off-by: Anna (cybertailor) Vyalkova --- eclass/nim-utils.eclass | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/eclass/nim-utils.eclass b/eclass/nim-utils.eclass index cdf1d78e3a..2cc241ac30 100644 --- a/eclass/nim-utils.eclass +++ b/eclass/nim-utils.eclass @@ -104,6 +104,18 @@ nim_get_buildtype() { fi } +# @FUNCTION: nim_get_colors +# @USAGE: +# @RETURN: "off" if colors should be disabled, "on" otherwise +nim_get_colors() { + debug-print-function ${FUNCNAME} "${@}" + + case ${NOCOLOR} in + true|yes) echo "off" ;; + *) echo "on" ;; + esac +} + # @FUNCTION: nim_gen_config # @USAGE: [] # @DESCRIPTION: @@ -133,8 +145,8 @@ nim_gen_config() { gcc.cpp.options.always:"${CPPFLAGS}" gcc.cpp.options.linker:"${LDFLAGS}" - $([[ "${NOCOLOR}" == true || "${NOCOLOR}" == yes ]] && echo '--colors:"off"') -d:"$(nim_get_buildtype)" + --colors:"$(nim_get_colors)" --parallelBuild:"$(makeopts_jobs)" $(printf "%s\n" ${NIMFLAGS}) EOF