From 7f989eeec368d3d051aa7f27e9ceea500e9415ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tiago=20Concei=C3=A7=C3=A3o?= Date: Sun, 20 Mar 2022 21:14:06 +0000 Subject: [PATCH] Support for arm64 on macOS --- build/libcvextern.sh | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/build/libcvextern.sh b/build/libcvextern.sh index 88264e7..f6f559c 100644 --- a/build/libcvextern.sh +++ b/build/libcvextern.sh @@ -9,11 +9,17 @@ # cd "$(dirname "$0")" directory="emgucv" +arch_name="$(uname -m)" osVariant="" +if [[ "$arch_name" != "x86_64" && "$arch_name" != "arm64" ]]; then + echo "Error: Unsupported host arch: $arch_name" + exit -1 +fi + for lastArg in $@; do :; done # Get last argument -if [[ $lastArg == "clean" ]]; then +if [ $lastArg == "clean" ]; then echo "Cleaning $directory directory" rm -rf "$directory" 2>/dev/null exit @@ -30,7 +36,7 @@ while getopts 'i' flag; do esac done -echo "Script to build libcvextern.so|dylib" +echo "Script to build libcvextern.so|dylib on $(uname -a) $arch_name" echo "- Detecting OS" [ "$installDependencies" == true ] && echo "- Installing all the dependencies" @@ -92,7 +98,11 @@ fi echo "- Bulding" if [ osVariant == "macOS" ]; then cd platforms/macos - ./configure + if [ "${arch_name}" = "x86_64" ]; then + ./configure_x86_64 + elif [ "${arch_name}" = "arm64" ]; then + ./configure_arm64 + fi else cd platforms/ubuntu/20.04 ./cmake_configure