message: Check if iOS support is enabled before building the benchmark framework
diff: # ==============================================================================
  set -e
  -set -x
  -WORKSPACE_ROOT=$(bazel info workspace)
  +WORKSPACE_ROOT=$(bazel info workspace 2> /dev/null)
  BENCHMARK_DIR=tensorflow/lite/tools/benchmark
  DEST_DIR="${BENCHMARK_DIR}/ios/TFLiteBenchmark/TFLiteBenchmark/Frameworks"
  FRAMEWORK_TARGET=TensorFlowLiteBenchmarkC_framework
  -usage() {
  +function usage() {
  echo "Usage: $(basename "$0") [-p]"
  echo "-p enable profiling"
  exit 1
  @@ -37,6 +36,17 @@ while getopts "p" opt_name; do
  done
  shift $(($OPTIND - 1))
  +function check_ios_configured() {
  + if [ ! -f "${WORKSPACE_ROOT}/${BENCHMARK_DIR}/experimental/ios/BUILD" ]; then
  + echo "ERROR: Benchmark framework BUILD file not found."
  + echo "Please enable iOS support by running the \"./configure\" script" \
  + "from the workspace root."
  + exit 1
  + fi
  +}
  +
  +function build_framework() {
  + set -x
  pushd "${WORKSPACE_ROOT}"
  # Build the framework.
  @@ -53,3 +63,8 @@ rm -f "${FRAMEWORK_TARGET}.zip"
  popd
  popd
  +}
  +
  +check_ios_configured
  +build_framework
  +
  