Skip to content

Commit

Permalink
add android build for assimp
Browse files Browse the repository at this point in the history
  • Loading branch information
luc committed May 13, 2024
1 parent 16c0410 commit 98af69d
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 3 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/build-dep-assimp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,13 @@ jobs:
path: ${{ github.workspace }}/externals/prebuilt/linux_assimp_v5.4.0


- name: Run andv8 build script
working-directory: ${{ github.workspace }}/externals/prebuild_scripts/
run: ./build_assimp_for_andV8.sh v5.4.0

- name: Archive prebuilt assimp
uses: actions/upload-artifact@v3
with:
name: prebuilt-assimp-android
path: ${{ github.workspace }}/externals/prebuilt/andV8_assimp_v5.4.0

21 changes: 18 additions & 3 deletions externals/prebuild_scripts/build_assimp_for_andV8.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ ZIPFILE="$ARCH"_assimp_"$assimp_VERSION"
ZIPFOLDER=$ZIPFILE
BUILD_D="$ARCH"_debug_"$assimp_VERSION"
BUILD_R="$ARCH"_release_"$assimp_VERSION"
NDK_VERSION="26.2.11394342"
#ANDROID_NDK_VERSION="26.2.11394342"
ANDROID_NDK_VERSION="r26d"
WORK_PATH=$(cd "$(dirname "$0")";pwd)
export ANDROID_NDK_HOME="android-ndk-$ANDROID_NDK_VERSION"
export ANDROID_NDK_PATH=${WORK_PATH}/${ANDROID_NDK_HOME}
export ANDROID_NDK_ROOT=${ANDROID_NDK_PATH}

clear
echo "Building assimp Version: $assimp_VERSION"
Expand All @@ -20,6 +25,14 @@ if [ "$#" -lt 1 ]; then
exit
fi


if [ ! -d $ANDROID_NDK_HOME ]
then
wget https://dl.google.com/android/repository/android-ndk-${ANDROID_NDK_VERSION}-linux.zip
unzip android-ndk-${ANDROID_NDK_VERSION}-linux.zip
fi


# Cloning assimp
if [ ! -d "assimp/.git" ]; then
git clone https://github.com/assimp/assimp
Expand All @@ -37,6 +50,8 @@ else
exit
fi

export PATH=$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin:$ANDROID_NDK_ROOT/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin:$ANDROID_NDK_ROOT/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin:$PATH

# Make build folder for debug version
rm -rf $BUILD_D
mkdir $BUILD_D
Expand All @@ -45,7 +60,7 @@ cd $BUILD_D
# Run cmake to configure and generate the make files

cmake \
-DCMAKE_TOOLCHAIN_FILE=~/Android/Sdk/ndk/$NDK_VERSION/build/cmake/android.toolchain.cmake \
-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_ROOT/build/cmake/android.toolchain.cmake \
-DANDROID_ABI=arm64-v8a \
-DANDROID_PLATFORM=android-N \
-DCMAKE_INSTALL_PREFIX=install \
Expand All @@ -68,7 +83,7 @@ cd $BUILD_R

# Run cmake to configure and generate the make files
cmake \
-DCMAKE_TOOLCHAIN_FILE=~/Android/Sdk/ndk/$NDK_VERSION/build/cmake/android.toolchain.cmake \
-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_ROOT/build/cmake/android.toolchain.cmake \
-DANDROID_ABI=arm64-v8a \
-DANDROID_PLATFORM=android-N \
-DCMAKE_INSTALL_PREFIX=install \
Expand Down

0 comments on commit 98af69d

Please sign in to comment.