瀏覽代碼

fix building on macOS (#36)

Fangjun Kuang 2 年之前
父節點
當前提交
be3a66d713
共有 3 個文件被更改,包括 31 次插入0 次删除
  1. 7 0
      build-android-arm64-v8a.sh
  2. 12 0
      build-android-armv7-eabi.sh
  3. 12 0
      build-android-x86-64.sh

+ 7 - 0
build-android-arm64-v8a.sh

@@ -15,6 +15,13 @@ if [ -z $ANDROID_NDK ]; then
   #
   # Inside the $ANDROID_NDK directory, you can find a binary ndk-build
   # and some other files like the file "build/cmake/android.toolchain.cmake"
+
+  if [ ! -d $ANDROID_NDK ]; then
+    # For macOS, I have installed Android Studio, select the menu
+    # Tools -> SDK manager -> Android SDK
+    # and set "Android SDK location" to /Users/fangjun/software/my-android
+    ANDROID_NDK=/Users/fangjun/software/my-android/ndk/22.1.7171670
+  fi
 fi
 
 if [ ! -d $ANDROID_NDK ]; then

+ 12 - 0
build-android-armv7-eabi.sh

@@ -15,6 +15,18 @@ if [ -z $ANDROID_NDK ]; then
   #
   # Inside the $ANDROID_NDK directory, you can find a binary ndk-build
   # and some other files like the file "build/cmake/android.toolchain.cmake"
+
+  if [ ! -d $ANDROID_NDK ]; then
+    # For macOS, I have installed Android Studio, select the menu
+    # Tools -> SDK manager -> Android SDK
+    # and set "Android SDK location" to /Users/fangjun/software/my-android
+    ANDROID_NDK=/Users/fangjun/software/my-android/ndk/22.1.7171670
+  fi
+fi
+
+if [ ! -d $ANDROID_NDK ]; then
+  echo Please set the environment variable ANDROID_NDK before you run this script
+  exit 1
 fi
 
 echo "ANDROID_NDK: $ANDROID_NDK"

+ 12 - 0
build-android-x86-64.sh

@@ -15,6 +15,18 @@ if [ -z $ANDROID_NDK ]; then
   #
   # Inside the $ANDROID_NDK directory, you can find a binary ndk-build
   # and some other files like the file "build/cmake/android.toolchain.cmake"
+
+  if [ ! -d $ANDROID_NDK ]; then
+    # For macOS, I have installed Android Studio, select the menu
+    # Tools -> SDK manager -> Android SDK
+    # and set "Android SDK location" to /Users/fangjun/software/my-android
+    ANDROID_NDK=/Users/fangjun/software/my-android/ndk/22.1.7171670
+  fi
+fi
+
+if [ ! -d $ANDROID_NDK ]; then
+  echo Please set the environment variable ANDROID_NDK before you run this script
+  exit 1
 fi
 
 echo "ANDROID_NDK: $ANDROID_NDK"