carthage.sh 1.0 KB

12345678910111213141516171819202122
  1. #!/usr/bin/env bash
  2. #
  3. # This script exists due to an issue with Carthage. The script comes from https://github.com/Carthage/Carthage/issues/3019#issuecomment-665136323
  4. # carthage.sh
  5. # Usage example: ./carthage.sh build --platform iOS
  6. echo "This script exists due to an issue with Carthage. The script comes from https://github.com/Carthage/Carthage/issues/3019#issuecomment-665136323"
  7. set -euo pipefail
  8. xcconfig=$(mktemp /tmp/static.xcconfig.XXXXXX)
  9. trap 'rm -f "$xcconfig"' INT TERM HUP EXIT
  10. # For Xcode 12 make sure EXCLUDED_ARCHS is set to arm architectures otherwise
  11. # the build will fail on lipo due to duplicate architectures.
  12. echo 'EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64__XCODE_1200 = arm64 arm64e armv7 armv7s armv6 armv8' >> $xcconfig
  13. 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
  14. export XCODE_XCCONFIG_FILE="$xcconfig"
  15. carthage "$@"