microsoft/onnxruntime-extensions
Publicmirrored from https://github.com/microsoft/onnxruntime-extensionsAvailable
build.android
22lines · modecode
| 1 | #!/bin/bash |
| 2 | |
| 3 | # The example file on building the static library for android |
| 4 | set -e -x -u |
| 5 | |
| 6 | OSNAME=android |
| 7 | if [[ -z ${NDK_ROOT+x} ]]; then NDK_ROOT=`ls -d $HOME/Android/Sdk/ndk/* 2>/dev/null`; fi |
| 8 | if [[ -z "${NDK_ROOT}" ]] |
| 9 | then |
| 10 | echo "ERROR: cannot find where NDK was installed, using NDK_ROOT to specify it" |
| 11 | exit 7 |
| 12 | fi |
| 13 | |
| 14 | mkdir -p out/$OSNAME/Release && cd out/$OSNAME/Release |
| 15 | |
| 16 | cmake "$@" \ |
| 17 | -DCMAKE_TOOLCHAIN_FILE=${NDK_ROOT}/build/cmake/android.toolchain.cmake \ |
| 18 | -DANDROID_NDK=${NDK_ROOT} \ |
| 19 | -DANDROID_ABI=armeabi-v7a \ |
| 20 | -DANDROID_PLATFORM=android-19 \ |
| 21 | -DOCOS_ENABLE_SPM_TOKENIZER=ON \ |
| 22 | ../../.. && cmake --build . --config Release --parallel |
| 23 | |