mirror of
https://github.com/zhigang1992/facebook-ios-sdk.git
synced 2026-01-12 17:22:28 +08:00
Reviewed By: aaronabramov Differential Revision: D33331776 fbshipit-source-id: 31b16e5e4cd0bb26c1e7cf49d9f8168eefdfe5ce
33 lines
1.4 KiB
Bash
Executable File
33 lines
1.4 KiB
Bash
Executable File
#!/bin/bash
|
|
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
# All rights reserved.
|
|
#
|
|
# This source code is licensed under the license found in the
|
|
# LICENSE file in the root directory of this source tree.
|
|
|
|
# carthage.sh
|
|
# Xcode 12 workaround.
|
|
# See: https://github.com/Carthage/Carthage/blob/master/Documentation/Xcode12Workaround.md
|
|
#
|
|
# 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.
|
|
|
|
CURRENT_XCODE_VERSION=$(xcodebuild -version | grep "Build version" | cut -d' ' -f3)
|
|
|
|
# Disabling check since Xcode will be expanding vars
|
|
# shellcheck disable=SC2016
|
|
{
|
|
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 i386"
|
|
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))'
|
|
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"
|