From 33994ec9db1ae34f94c6ca65e6683dfee28b5b6e Mon Sep 17 00:00:00 2001 From: Gregor Klevze Date: Sun, 30 Nov 2025 14:16:33 +0100 Subject: [PATCH] fix for max --- build-production-mac.sh | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/build-production-mac.sh b/build-production-mac.sh index e4a0b06..94f99af 100644 --- a/build-production-mac.sh +++ b/build-production-mac.sh @@ -156,7 +156,7 @@ copy_dependencies() { log INFO "Collecting dynamic libraries from vcpkg..." local triplets=("arm64-osx" "x64-osx" "universal-osx") local bases=("$BUILD_DIR/vcpkg_installed" "vcpkg_installed") - declare -A copied=() + local copied_names=() for base in "${bases[@]}"; do for triplet in "${triplets[@]}"; do @@ -165,9 +165,16 @@ copy_dependencies() { if [[ -d "$dir" ]]; then while IFS= read -r -d '' dylib; do local name=$(basename "$dylib") - if [[ -z ${copied[$name]:-} ]]; then + local seen=0 + for existing in "${copied_names[@]}"; do + if [[ "$existing" == "$name" ]]; then + seen=1 + break + fi + done + if (( !seen )); then cp "$dylib" "$PACKAGE_DIR/" - copied[$name]=1 + copied_names+=("$name") log OK "Copied $name" fi done < <(find "$dir" -maxdepth 1 -type f -name '*.dylib' -print0) @@ -176,7 +183,7 @@ copy_dependencies() { done done - if [[ ${#copied[@]} -eq 0 ]]; then + if [[ ${#copied_names[@]} -eq 0 ]]; then log WARN "No .dylib files found; ensure vcpkg installed macOS triplet dependencies." fi }