From 9218239e460438dc15d32f237595b4a32d205882 Mon Sep 17 00:00:00 2001 From: Roman Melnyk Date: Thu, 8 Sep 2022 17:45:27 +0300 Subject: [PATCH] #34610 Fix invalid range "t-5" in string transliteration [iOS] for M1 pod install issue. --- scripts/cocoapods/utils.rb | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/scripts/cocoapods/utils.rb b/scripts/cocoapods/utils.rb index bc14b58378e27c..b93df4e66b5647 100644 --- a/scripts/cocoapods/utils.rb +++ b/scripts/cocoapods/utils.rb @@ -139,14 +139,16 @@ def self.fix_library_search_path(config) return end - # $(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME) causes problem with Xcode 12.5 + arm64 (Apple M1) - # since the libraries there are only built for x86_64 and i386. - lib_search_paths.delete("$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)") - lib_search_paths.delete("\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)\"") - - if !(lib_search_paths.include?("$(SDKROOT)/usr/lib/swift") || lib_search_paths.include?("\"$(SDKROOT)/usr/lib/swift\"")) - # however, $(SDKROOT)/usr/lib/swift is required, at least if user is not running CocoaPods 1.11 - lib_search_paths.insert(0, "$(SDKROOT)/usr/lib/swift") + if lib_search_paths.include?("$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)") || lib_search_paths.include?("\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)\"") + # $(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME) causes problem with Xcode 12.5 + arm64 (Apple M1) + # since the libraries there are only built for x86_64 and i386. + lib_search_paths.delete("$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)") + lib_search_paths.delete("\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)\"") + + if !(lib_search_paths.include?("$(SDKROOT)/usr/lib/swift") || lib_search_paths.include?("\"$(SDKROOT)/usr/lib/swift\"")) + # however, $(SDKROOT)/usr/lib/swift is required, at least if user is not running CocoaPods 1.11 + lib_search_paths.insert(0, "$(SDKROOT)/usr/lib/swift") + end end end