carthage.sh 1.5 KB

123456789101112131415161718192021222324252627282930313233343536
  1. #!/usr/bin/env bash
  2. # _____ _
  3. # |_ _| |_ _ _ ___ ___ _ __ __ _
  4. # | | | ' \| '_/ -_) -_) ' \/ _` |_
  5. # |_| |_||_|_| \___\___|_|_|_\__,_(_)
  6. #
  7. # Threema iOS Client
  8. # Copyright (c) 2020 Threema GmbH
  9. #
  10. # This program is free software: you can redistribute it and/or modify
  11. # it under the terms of the GNU Affero General Public License, version 3,
  12. # as published by the Free Software Foundation.
  13. #
  14. # This program is distributed in the hope that it will be useful,
  15. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. # GNU Affero General Public License for more details.
  18. #
  19. # You should have received a copy of the GNU Affero General Public License
  20. # along with this program. If not, see <https://www.gnu.org/licenses/>.
  21. #
  22. # Based on https://github.com/Carthage/Carthage/blob/master/Documentation/Xcode12Workaround.md
  23. set -euo pipefail
  24. xcconfig=$(mktemp /tmp/static.xcconfig.XXXXXX)
  25. trap 'rm -f "$xcconfig"' INT TERM HUP EXIT
  26. # For Xcode 12 make sure EXCLUDED_ARCHS is set to arm architectures otherwise
  27. # the build will fail on lipo due to duplicate architectures.
  28. echo 'EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64__XCODE_1200 = arm64 arm64e armv7 armv7s armv6 armv8' >> $xcconfig
  29. 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
  30. export XCODE_XCCONFIG_FILE="$xcconfig"
  31. carthage "$@"