common/build-helper/meson.sh: only write cross file once

This commit is contained in:
Andrew J. Hesford 2023-10-26 09:18:13 -04:00
parent 1cce32c070
commit 557b4a73cf

View file

@ -1,7 +1,12 @@
# This build helper writes a Meson cross-file, allowing other build styles
# to properly drive cross-builds in Meson when appropriate
if [ -n "$CROSS_BUILD" ]; then
# Action is only taken for cross builds
[ -z "$CROSS_BUILD" ] && return 0
# The cross file should only be written once, unless forced
[ -e "${XBPS_WRAPPERDIR}/meson/xbps_meson.cross" ] && [ -z "$XBPS_BUILD_FORCEMODE" ] && return 0
mkdir -p "${XBPS_WRAPPERDIR}/meson"
_MESON_TARGET_ENDIAN=little
@ -79,4 +84,3 @@ if [ -n "$CROSS_BUILD" ]; then
EOF
unset _MESON_CPU_FAMILY _MESON_TARGET_CPU _MESON_TARGET_ENDIAN _MESON_EXE_WRAPPER
fi