mirror of
https://github.com/flatcar/scripts.git
synced 2026-05-05 04:06:33 +02:00
eclass/meson: Sync with Gentoo
It's from Gentoo commit 3de1dd6e7da09404b32449eed5f19af12d72b9e3. Signed-off-by: Flatcar Buildbot <buildbot@flatcar-linux.org>
This commit is contained in:
parent
6f10fa4cf5
commit
8164e69e37
@ -76,8 +76,8 @@ BDEPEND=">=dev-build/meson-1.2.3
|
||||
# @VARIABLE: emesonargs
|
||||
# @DEFAULT_UNSET
|
||||
# @DESCRIPTION:
|
||||
# Optional meson arguments as Bash array; this should be defined before
|
||||
# calling meson_src_configure.
|
||||
# Optional meson arguments as Bash array; this should be defined before calling
|
||||
# meson_src_configure, meson_add_machine_file, or meson_add_native_file.
|
||||
|
||||
# @VARIABLE: MYMESONARGS
|
||||
# @DEFAULT_UNSET
|
||||
@ -271,6 +271,33 @@ _meson_create_native_file() {
|
||||
echo "${fn}"
|
||||
}
|
||||
|
||||
# @FUNCTION: meson_add_machine_file
|
||||
# @USAGE: <name> < <data>
|
||||
# @DESCRIPTION:
|
||||
# Appends --native-file or --cross-file to emesonargs with the data given via
|
||||
# standard input. Assumes emesonargs has already been defined as an array.
|
||||
meson_add_machine_file() {
|
||||
local file=${T}/meson.${CHOST}.${ABI}.${1}.ini
|
||||
cat > "${file}" || die
|
||||
|
||||
if tc-is-cross-compiler || [[ ${ABI} != "${DEFAULT_ABI}" ]]; then
|
||||
emesonargs+=( --cross-file "${file}" )
|
||||
else
|
||||
emesonargs+=( --native-file "${file}" )
|
||||
fi
|
||||
}
|
||||
|
||||
# @FUNCTION: meson_add_native_file
|
||||
# @USAGE: <name> < <data>
|
||||
# @DESCRIPTION:
|
||||
# Appends --native-file (never --cross-file) to emesonargs with the data given
|
||||
# via standard input. Assumes emesonargs has already been defined as an array.
|
||||
meson_add_native_file() {
|
||||
# Ensure the filename is unique by including the target tuple and ABI.
|
||||
local name=${CHOST}.${ABI}.${1} CHOST=${CBUILD} ABI=${DEFAULT_ABI}
|
||||
meson_add_machine_file "${name}"
|
||||
}
|
||||
|
||||
# @FUNCTION: meson_use
|
||||
# @USAGE: <USE flag> [option name]
|
||||
# @DESCRIPTION:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user