Added more processor ABIs to shell scripts.

PiperOrigin-RevId: 331809692
Change-Id: I1398cb15485296afca446f15119aee113d01bbcb
This commit is contained in:
Raman Sarokin 2020-09-15 11:08:10 -07:00 committed by TensorFlower Gardener
parent 876386c45d
commit 864350a2cc
2 changed files with 18 additions and 6 deletions

View File

@ -64,11 +64,17 @@ trap "cleanup_device" EXIT
declare -a BUILD_CONFIG
abi_version=$(ADB shell getprop ro.product.cpu.abi | tr -d '\r')
if [[ "$abi_version" == "armeabi-v7a" ]]; then
#"32 bit"
#"32 bit ARM"
BUILD_CONFIG=( --config=android_arm -c opt --copt=-fPIE --linkopt=-pie )
else
#"64 bit"
elif [[ "$abi_version" == "arm64-v8a" ]]; then
#"64 bit ARM"
BUILD_CONFIG=( --config=android_arm64 -c opt )
elif [[ "$abi_version" == "x86_64" ]]; then
# x86_64
BUILD_CONFIG=( --config=android_x86_64 -c opt )
else
echo "Error: Unknown processor ABI"
exit 1
fi
targets=($(bazel query 'tests('$test_target')'))

View File

@ -78,11 +78,17 @@ ADB push "$model_path" "$OPENCL_DIR"
declare -a BUILD_CONFIG
abi_version=$(ADB shell getprop ro.product.cpu.abi | tr -d '\r')
if [[ "$abi_version" == "armeabi-v7a" ]]; then
#"32 bit"
#"32 bit ARM"
BUILD_CONFIG=( --config=android_arm -c opt --copt=-fPIE --linkopt=-pie )
else
#"64 bit"
elif [[ "$abi_version" == "arm64-v8a" ]]; then
#"64 bit ARM"
BUILD_CONFIG=( --config=android_arm64 -c opt )
elif [[ "$abi_version" == "x86_64" ]]; then
# x86_64
BUILD_CONFIG=( --config=android_x86_64 -c opt )
else
echo "Error: Unknown processor ABI"
exit 1
fi
bazel build "${BUILD_CONFIG[@]}" //$SHELL_DIR:$BINARY_NAME