wcarthage 1.1 KB

12345678910111213141516171819
  1. # carthage.sh
  2. # Usage example: ./carthage.sh build --platform iOS
  3. set -euo pipefail
  4. xcconfig=$(mktemp /tmp/static.xcconfig.XXXXXX)
  5. trap 'rm -f "$xcconfig"' INT TERM HUP EXIT
  6. # For Xcode 12 make sure EXCLUDED_ARCHS is set to arm architectures otherwise
  7. # the build will fail on lipo due to duplicate architectures.
  8. CURRENT_XCODE_VERSION=$(xcodebuild -version | grep "Build version" | cut -d' ' -f3)
  9. echo "EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64__XCODE_1200__BUILD_$CURRENT_XCODE_VERSION = arm64 arm64e armv7 armv7s armv6 armv8" >> $xcconfig
  10. echo 'EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64__XCODE_1200 = $(EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64__XCODE_1200__BUILD_$(XCODE_PRODUCT_BUILD_VERSION))' >> $xcconfig
  11. 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
  12. export XCODE_XCCONFIG_FILE="$xcconfig"
  13. carthage "$@"