From 5898a2a484380a14fbe080c482b93c6cd0da3f70 Mon Sep 17 00:00:00 2001 From: Aiken Harris Date: Tue, 8 Jul 2025 09:59:35 +0200 Subject: [PATCH] Post build --- build.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/build.sh b/build.sh index 8fc0e70..0487324 100755 --- a/build.sh +++ b/build.sh @@ -376,6 +376,7 @@ xtchain_build() xtchain_tarball() { local EXTENSION="" + local LIBDIR="" # Additional, target-specific configuration options case "${SYSTEM_NAME}" in @@ -398,6 +399,22 @@ xtchain_tarball() [ ${BUILD_MINIMAL} -eq 1 ] && XTCVER="${XTCVER}-min" echo "${XTCVER}" > ${BINDIR}/Version + # Windows target specific actions + if [ "${SYSTEM_NAME}" == "Windows" ]; then + # Replace symlinks with original files + for LINK in $(find ${BINDIR}/bin -maxdepth 1 -type l); do + cp -f --remove-destination $(readlink -e ${LINK}) ${LINK} + done + + # Copy dynamic libraries + if [ ${BUILD_MINIMAL} -eq 0 ]; then + LIBDIR="$(dirname $(readlink -f $(command -v ${SYSTEM_HOST}-windres)))/../${SYSTEM_HOST}" + for DLL in $(${SYSTEM_HOST}-objdump --private-headers ${BINDIR}/bin/cmake.exe | grep "DLL Name:" | cut -d' ' -f3 | grep "lib.*.dll"); do + find ${LIBDIR} -type f -name ${DLL} -exec cp {} ${BINDIR}/bin \; + done + fi + fi + # Build tarball echo ">>> Creating toolchain archive ..." tar -I 'zstd -19' -cpf xtchain-${XTCVER}-${TARGET_SYSTEM}.tar.zst -C ${BINDIR} .