eclass/llvm-utils: Sync with Gentoo

It's from Gentoo commit b465171bf81e25c18bc6443185215e6f80838766.
This commit is contained in:
Flatcar Buildbot 2025-03-17 07:08:32 +00:00 committed by Krzesimir Nowak
parent a2fc6c9fa1
commit 8f6331e169

View File

@ -1,4 +1,4 @@
# Copyright 2024 Gentoo Authors
# Copyright 2024-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: llvm-utils.eclass
@ -171,4 +171,19 @@ llvm_prepend_path() {
export PATH=${new_path[*]}
}
# @FUNCTION: llvm_cmake_use_musl
# @DESCRIPTION:
# Determine whether the given LLVM project should be built with musl
# support. That should be the case if the CTARGET (or CHOST) is a musl
# environment.
#
# If musl should be used, echo "ON", otherwise echo "OFF".
llvm_cmake_use_musl() {
if [[ "${CTARGET:-${CHOST}}" == *-*-*-musl* ]]; then
echo "ON"
else
echo "OFF"
fi
}
fi