File: build_ios.sh

package info (click to toggle)
pytorch-vision 0.14.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 15,188 kB
  • sloc: python: 49,008; cpp: 10,019; sh: 610; java: 550; xml: 79; objc: 56; makefile: 32
file content (30 lines) | stat: -rwxr-xr-x 725 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash

set -ex -o pipefail
echo ""
echo "DIR: $(pwd)"
VISION_IOS_ROOT=$(dirname $(realpath $0))

if ! [ -n "${LIBTORCH_HEADER_ROOT:-}" ]; then
  echo "Missing parameter: LIBTORCH_HEADER_ROOT"
  exit 1
fi

if [ -n "${IOS_ARCH:-}" ]; then
  if [ "${IOS_ARCH:-}" == "arm64" ]; then
    IOS_PLATFORM="OS"
  elif [ "${IOS_ARCH:-}" == "x86_64" ]; then
    IOS_PLATFORM="SIMULATOR"
  fi
fi

mkdir -p ${VISION_IOS_ROOT}/lib
mkdir -p ${VISION_IOS_ROOT}/build
cd ${VISION_IOS_ROOT}/build
cmake -DLIBTORCH_HEADER_ROOT=${LIBTORCH_HEADER_ROOT}  \
      -DCMAKE_TOOLCHAIN_FILE=${VISION_IOS_ROOT}/../cmake/iOS.cmake \
      -DIOS_ARCH=${IOS_ARCH} \
      -DIOS_PLATFORM=${IOS_PLATFORM} \
      ..
make
rm -rf ${VISION_IOS_ROOT}/build