★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
➤微信公眾號:山青詠芝(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的同事將檢查這如何影響建築和運營。 得到結果后,我會報告。