★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
➤微信公众号:山青咏芝(shanqingyongzhi)
➤博客园地址:山青咏芝(https://www.cnblogs.com/strengthen/ )
➤GitHub地址:https://github.com/strengthen/LeetCode
➤原文地址:https://www.cnblogs.com/strengthen/p/14780899.html
➤如果链接不是山青咏芝的博客园地址,则可能是爬取作者的文章。
➤原文已修改更新!强烈建议点击原文地址阅读!支持作者!支持原创!
★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
Workaround that works with both Xcode 11 and 12
Works with all versions of Xcode 12 (except beta 1 and 2; but no-one should be using those anymore). Once XCFrameworks support lands in Carthage this workaround won’t be needed. However not that XCFrameworks puts some strict requirements on projects that most projects don’t comply with.
Note: This is a change from before where the script excluded arm64 for simulators by individual Xcode 12 version. It now removes it from all Xcode 12 based builds.
适用于所有版本的Xcode 12(除了beta 1和2;但现在没有人可以再使用那些版本)。 一旦XCFrameworks支持进入Carthage,就不需要此解决方法了。 但是,并非如此,XCFrameworks对大多数项目都不遵守的项目提出了一些严格的要求。
注意:这是从以前的脚本更改开始的更改,在脚本之前,脚本未按单独的Xcode 12版本将arm64用于模拟器。 现在,它从所有基于Xcode 12的版本中将其删除。
How to use
- Save the script (👇) to your project (e.g. as a
carthage.sh
file). - Make the script executable
chmod +x carthage.sh
- Instead of calling
carthage ...
call./carthage.sh ...
- E.g.
./carthage.sh build
or./carthage.sh update --use-submodules
- E.g.
如何使用
1、将脚本(👇)保存到您的项目中(例如,作为carthage.sh文件)。
2、使脚本可执行chmod + x carthage.sh
3、而不是调用carthage ...调用./carthage.sh ...
例如。 ./carthage.sh构建或./carthage.sh更新--use-submodules
Script
#!/usr/bin/env bash # carthage.sh # Usage example: ./carthage.sh build --platform iOS set -euo pipefail xcconfig=$(mktemp /tmp/static.xcconfig.XXXXXX) trap 'rm -f "$xcconfig"' INT TERM HUP EXIT # For Xcode 12 make sure EXCLUDED_ARCHS is set to arm architectures otherwise # the build will fail on lipo due to duplicate architectures. 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 export XCODE_XCCONFIG_FILE="$xcconfig" carthage "$@"
To make the workaround work with both Xcode 11 and 12 I had to tweak the `EXCLUDED_ARCHS` statement a bit:
初始解决方案要使变通办法适用于Xcode 11和12,我必须对EXCLUDED_ARCHS语句进行一些调整:
#!/usr/bin/env bash # carthage-build.sh # Usage example: ./carthage-build.sh --platform iOS set -euo pipefail xcconfig=$(mktemp /tmp/static.xcconfig.XXXXXX) trap 'rm -f "$xcconfig"' INT TERM HUP EXIT # For Xcode 12 (beta 3+) make sure EXCLUDED_ARCHS is set to arm architectures otherwise # the build will fail on lipo due to duplicate architectures. 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 export XCODE_XCCONFIG_FILE="$xcconfig" carthage build "$@"
A colleague of mine with a DTK is going to check how this impacts building and running. I’ll report back once we have the results.
我的一位拥有DTK的同事将检查这如何影响建筑和运营。 得到结果后,我会报告。