Skip to content

Instantly share code, notes, and snippets.

@dive
Created June 1, 2021 15:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dive/e89b7e132b157f1457bcf6e1dd4f6872 to your computer and use it in GitHub Desktop.
Save dive/e89b7e132b157f1457bcf6e1dd4f6872 to your computer and use it in GitHub Desktop.
Carthage workaround for XCFrameworks and `arm64` arch
#!/usr/bin/env bash
# Usage example: ./carthage_update.sh Chatto
set -euo pipefail
xcconfig=$(mktemp /tmp/static.xcconfig.XXXXXX)
trap 'rm -f "$xcconfig"' INT TERM HUP EXIT
# Serialize dsym paths for running on different machines, required in order for lldb debugging to work on xcode 12+
echo 'SWIFT_SERIALIZE_DEBUGGING_OPTIONS = NO' >> "$xcconfig"
echo 'OTHER_SWIFT_FLAGS = $(inherited) -Xfrontend -no-serialize-debugging-options' >> "$xcconfig"
###########################################################
# Workaround for Apple Silicon `arm64` and Carthage issue #
# https://github.com/Carthage/Carthage/issues/3019 #
###########################################################
echo 'EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64__XCODE_1200 = arm64 arm64e armv7 armv7s armv6 armv8' >> "$xcconfig"
echo 'EXCLUDED_ARCHS = $(inherited) $(EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_$(EFFECTIVE_PLATFORM_SUFFIX)__NATIVE_ARCH_64_BIT_$(NATIVE_ARCH_64_BIT)__XCODE_$(XCODE_VERSION_MAJOR))' >> "$xcconfig"
##################
# Workaround end #
##################
export XCODE_XCCONFIG_FILE="$xcconfig"
carthage update --no-use-binaries --platform iOS "$@";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment