From a908862549f4504fd88bfbe5305dd3c34101ea77 Mon Sep 17 00:00:00 2001 From: "Anna (cybertailor) Vyalkova" Date: Mon, 8 May 2023 23:51:48 +0500 Subject: [PATCH] crystal-utils.eclass: add crystal_build function Signed-off-by: Anna (cybertailor) Vyalkova --- eclass/crystal-utils.eclass | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/eclass/crystal-utils.eclass b/eclass/crystal-utils.eclass index 09a4049a46..3c0b7d48aa 100644 --- a/eclass/crystal-utils.eclass +++ b/eclass/crystal-utils.eclass @@ -24,7 +24,7 @@ esac if [[ ! ${_CRYSTAL_UTILS_ECLASS} ]]; then _CRYSTAL_UTILS_ECLASS=1 -inherit edo flag-o-matic +inherit edo flag-o-matic multiprocessing # @ECLASS_VARIABLE: CRYSTAL_DEPS # @OUTPUT_VARIABLE @@ -151,4 +151,17 @@ eshards() { edo shards "${args[@]}" "${@}" } +# @FUNCTION: crystal_build +# @USAGE: ... +# @DESCRIPTION: +# Function for building a target. All arguments are passed to crystal. +crystal_build() { + local build_args=( + --threads=$(makeopts_jobs) + --verbose + ) + + ecrystal build "${build_args[@]}" "${@}" +} + fi