Skip to content

Commit

Permalink
feat(scripts): check tools before build libs
Browse files Browse the repository at this point in the history
  • Loading branch information
jhen0409 committed Jan 25, 2025
1 parent 0fb8056 commit 466e14b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
18 changes: 16 additions & 2 deletions scripts/build-android.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,24 @@
#! /bin/bash
#!/bin/bash -e

NDK_VERSION=26.1.10909125
NDK_VERSION=26.3.11579264
CMAKE_TOOLCHAIN_FILE=$ANDROID_HOME/ndk/$NDK_VERSION/build/cmake/android.toolchain.cmake
ANDROID_PLATFORM=android-21
CMAKE_BUILD_TYPE=Release

if [ ! -d "$ANDROID_HOME/ndk/$NDK_VERSION" ]; then
echo "NDK $NDK_VERSION not found, available versions: $(ls $ANDROID_HOME/ndk)"
echo "Run \$ANDROID_HOME/tools/bin/sdkmanager \"ndk;$NDK_VERSION\""
CMAKE_VERSION=3.10.2.4988404
echo "and \$ANDROID_HOME/tools/bin/sdkmanager \"cmake;$CMAKE_VERSION\""
exit 1
fi

# check cmake
if ! command -v cmake &> /dev/null; then
echo "cmake could not be found, please install it"
exit 1
fi

cd android/src/main

# Build the Android library (arm64-v8a)
Expand Down
7 changes: 6 additions & 1 deletion scripts/build-ios.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
#!/bin/bash
#!/bin/bash -e

if ! command -v cmake &> /dev/null; then
echo "cmake could not be found, please install it"
exit 1
fi

function cp_headers() {
mkdir -p ../ios/rnllama.xcframework/$1/rnllama.framework/Headers
Expand Down

0 comments on commit 466e14b

Please sign in to comment.