diff options
author | Anna (cybertailor) Vyalkova <cyber+gentoo@sysrq.in> | 2022-07-16 12:26:33 +0500 |
---|---|---|
committer | Anna (cybertailor) Vyalkova <cyber+gentoo@sysrq.in> | 2022-07-16 18:44:08 +0500 |
commit | 329f81b55286f9a72341b2402078fc4f0c46c8f9 (patch) | |
tree | cb8011e11cedb65297f1bfb79098ae4e5065363f /eclass/nim-utils.eclass | |
parent | nim-utils.eclass: allow debug builds (diff) | |
download | guru-329f81b55286f9a72341b2402078fc4f0c46c8f9.tar.gz guru-329f81b55286f9a72341b2402078fc4f0c46c8f9.tar.bz2 guru-329f81b55286f9a72341b2402078fc4f0c46c8f9.zip |
nim-utils.eclass: beautify NOCOLOR stuff
Signed-off-by: Anna (cybertailor) Vyalkova <cyber+gentoo@sysrq.in>
Diffstat (limited to 'eclass/nim-utils.eclass')
-rw-r--r-- | eclass/nim-utils.eclass | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/eclass/nim-utils.eclass b/eclass/nim-utils.eclass index cdf1d78e3..2cc241ac3 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: [<dir>] # @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 |