Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ios): exclude arm64 architecture from simulator build #11844

Merged
merged 7 commits into from
Aug 6, 2020
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,19 @@ UNIVERSAL_LIBRARY_DIR="${BUILD_DIR}/${CONFIGURATION}-iphoneuniversal"

FRAMEWORK="${UNIVERSAL_LIBRARY_DIR}/${FRAMEWORK_NAME}.framework"

XCODE_VERSION=$(/usr/libexec/PlistBuddy -c "Print :DTXcode" "$(xcode-select -p)/../Info.plist")

######################
# Build Frameworks
######################

xcodebuild -scheme ${PROJECT_NAME} -sdk iphonesimulator -configuration ${CONFIGURATION} clean build CONFIGURATION_BUILD_DIR=${BUILD_DIR}/${CONFIGURATION}-iphonesimulator 2>&1
# Exclude arm64 architecture from simulator build in XCode 12+- TIMOB-28042

if [[ $XCODE_VERSION -ge 1200 ]]; then
xcodebuild -scheme ${PROJECT_NAME} -sdk iphonesimulator EXCLUDED_ARCHS=arm64 -configuration ${CONFIGURATION} clean build CONFIGURATION_BUILD_DIR=${BUILD_DIR}/${CONFIGURATION}-iphonesimulator 2>&1
else
xcodebuild -scheme ${PROJECT_NAME} -sdk iphonesimulator -configuration ${CONFIGURATION} clean build CONFIGURATION_BUILD_DIR=${BUILD_DIR}/${CONFIGURATION}-iphonesimulator 2>&1
fi

xcodebuild -scheme ${PROJECT_NAME} -sdk iphoneos -configuration ${CONFIGURATION} clean build CONFIGURATION_BUILD_DIR=${BUILD_DIR}/${CONFIGURATION}-iphoneos 2>&1

Expand All @@ -42,7 +49,6 @@ mkdir "${FRAMEWORK}"

cp -r "${DEVICE_LIBRARY_PATH}/." "${FRAMEWORK}"


######################
# Make an universal binary
######################
Expand Down
5 changes: 5 additions & 0 deletions iphone/cli/commands/_buildModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,11 @@ iOSModuleBuilder.prototype.buildModule = function buildModule(next) {
args.push('CONFIGURATION_BUILD_DIR=' + path.join(this.projectDir, 'build', 'Release-' + target));
}

// Exclude arm64 architecture from simulator build in XCode 12+ - TIMOB-28042
if (target === 'iphonesimulator' && parseFloat(this.xcodeEnv.version) >= 12.0) {
args.push('EXCLUDED_ARCHS=arm64');
}

return args;
}.bind(this);

Expand Down
9 changes: 9 additions & 0 deletions support/iphone/build_titaniumkit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ sed -i '' 's@__GITHASH__@'"$GIT_HASH"'@g' TitaniumKit/Sources/API/TopTiModule.m

REVEAL_ARCHIVE_IN_FINDER=false

XCODE_VERSION=$(/usr/libexec/PlistBuddy -c "Print :DTXcode" "$(xcode-select -p)/../Info.plist")

FRAMEWORK_NAME="TitaniumKit"

SIMULATOR_LIBRARY_PATH="$(pwd)/build/Release-iphonesimulator/${FRAMEWORK_NAME}.framework"
Expand All @@ -61,8 +63,15 @@ FRAMEWORK="${UNIVERSAL_LIBRARY_DIR}/${FRAMEWORK_NAME}.framework"
XCPRETTY="xcpretty"
which xcpretty || XCPRETTY="cat"

# Exclude arm64 architecture from simulator build in XCode 12+ - TIMOB-28042

if [[ $XCODE_VERSION -ge 1200 ]]; then
xcodebuild -scheme TitaniumKit -sdk iphonesimulator EXCLUDED_ARCHS=arm64 -configuration Release clean build CONFIGURATION_BUILD_DIR=build/Release-iphonesimulator | eval $XCPRETTY
[[ PIPESTATUS[0] -ne 0 ]] && exit 1
else
xcodebuild -scheme TitaniumKit -sdk iphonesimulator -configuration Release clean build CONFIGURATION_BUILD_DIR=build/Release-iphonesimulator | eval $XCPRETTY
[[ PIPESTATUS[0] -ne 0 ]] && exit 1
fi

xcodebuild -scheme TitaniumKit -sdk iphoneos -configuration Release clean build CONFIGURATION_BUILD_DIR=build/Release-iphoneos | eval $XCPRETTY
[[ PIPESTATUS[0] -ne 0 ]] && exit 1
Expand Down