• [gentoo-dev] [PATCH 06/11] llvm-r2.eclass: Add llvm_chost_setup, set CM

    From =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?@21:1/5 to All on Sat Dec 21 17:10:02 2024
    Add a llvm_chost_setup function that handles CHOST-specific setup.
    Initially, this means setting CMake variables that control
    `find_package()` lookups.

    Signed-off-by: Michał Górny <mgorny@gentoo.org>
    ---
    eclass/llvm-r2.eclass | 37 ++++++++++++++++++++++++++++++-------
    1 file changed, 30 insertions(+), 7 deletions(-)

    diff --git a/eclass/llvm-r2.eclass b/eclass/llvm-r2.eclass
    index 93c16e75be83..91e841821331 100644
    --- a/eclass/llvm-r2.eclass
    +++ b/eclass/llvm-r2.eclass
    @@ -248,16 +248,35 @@ llvm_cbuild_setup() {
    llvm_prepend_path -b "${LLVM_SLOT}"
    }

    -# @FUNCTION: llvm-r2_pkg_setup
    +# @FUNCTION: llvm_chost_setup
    # @DESCRIPTION:
    -# Prepend the appropriate executable directory for the selected LLVM
    -# slot to PATH.
    +# Set the environment for finding selected LLVM slot installed
    +# for CHOST.
    #
    -# The PATH manipulation is only done for source builds. The function
    -# is a no-op when installing a binary package.
    +# This function is meant to be used when the package in question uses
    +# LLVM compiles against and links to LLVM. It is called automatically
    +# by llvm-r2_pkg_setup if LLVM is found installed in ESYSROOT. +llvm_chost_setup() {
    + debug-print-function ${FUNCNAME} "$@"