Add android libs cmake

This commit is contained in:
Tal Regev 2022-04-17 01:11:01 +03:00
parent 553adcf28f
commit 2da6abec68
No known key found for this signature in database
GPG Key ID: A421558E0F87AC82
7 changed files with 104 additions and 17 deletions

View File

@ -18,7 +18,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
type: [manager, libs, apps, manager-vcpkg, libs-vcpkg, apps-vcpkg]
type: [manager, libs, apps, manager-vcpkg, libs-vcpkg, apps-vcpkg, libs-cmake]
fail-fast: false
steps:
- uses: actions/checkout@v2
@ -76,6 +76,10 @@ jobs:
if: ${{ success() && matrix.type == 'apps-vcpkg' }}
run: ./android/ci_build_vcpkg_apps.sh
- name: Build libs with cmake
if: ${{ success() && matrix.type == 'libs-cmake' }}
run: ./android/ci_build_libs_cmake.sh
- name: Prepare logs on failure
if: ${{ failure() }}
run: 7z a -t7z -mx=9 deploy/logs.7z config.log android/BOINC/app/build/reports/ -r0 3rdParty/android/vcpkg/buildtrees/*.log

1
.gitignore vendored
View File

@ -234,4 +234,5 @@ vda/vdad
# cmake build
build/
build-*/

View File

@ -0,0 +1,20 @@
#!/bin/sh
set -e
PLATFORM_NAME="android"
if [ ! -d "$PLATFORM_NAME" ]; then
echo "start this script in the source root directory"
exit 1
fi
BUILD_DIR="$PWD/3rdParty/$PLATFORM_NAME"
VCPKG_ROOT="$BUILD_DIR/vcpkg"
if [ ! -d $VCPKG_ROOT ]; then
mkdir -p $BUILD_DIR
git -C $BUILD_DIR clone https://github.com/microsoft/vcpkg
fi
git -C $VCPKG_ROOT pull
$VCPKG_ROOT/bootstrap-vcpkg.sh

View File

@ -24,8 +24,6 @@ export REV=1
export ARMV6_REV=1
export OPENSSL_VERSION=1.1.1l
export CURL_VERSION=7.80.0
export NDK_VERSION=21d
export NDK_ARMV6_VERSION=15c
# checks if a given path is canonical (absolute and does not contain relative links)
# from http://unix.stackexchange.com/a/256437
@ -145,10 +143,9 @@ if [ "${silent}" = "yes" ]; then
export STDOUT_TARGET="/dev/null"
fi
. $(pwd)/ndk_common.sh
export NDK_FLAGFILE="$PREFIX/NDK-${NDK_VERSION}-${REV}_done"
export NDK_ARMV6_FLAGFILE="$PREFIX/NDK-${NDK_ARMV6_VERSION}-armv6-${ARMV6_REV}_done"
export NDK_ROOT=$BUILD_DIR/android-ndk-r${NDK_VERSION}
export NDK_ARMV6_ROOT=$BUILD_DIR/android-ndk-r${NDK_ARMV6_VERSION}
export OPENSSL_SRC=$BUILD_DIR/openssl-${OPENSSL_VERSION}
export CURL_SRC=$BUILD_DIR/curl-${CURL_VERSION}
export VCPKG_ROOT="$BUILD_DIR/vcpkg"
@ -167,19 +164,7 @@ else
export ANDROID_TC_FLAGFILE="$PREFIX/ANDROID_TC_WITH_NDK-${NDK_VERSION}-${arch}-${REV}_done"
fi
createNDKFolder()
{
rm -rf "$BUILD_DIR/android-ndk-r${NDK_VERSION}"
wget -c --no-verbose -O /tmp/ndk_${NDK_VERSION}.zip https://dl.google.com/android/repository/android-ndk-r${NDK_VERSION}-linux-x86_64.zip
unzip -qq /tmp/ndk_${NDK_VERSION}.zip -d $BUILD_DIR
}
createNDKARMV6Folder()
{
rm -rf "$BUILD_DIR/android-ndk-r${NDK_ARMV6_VERSION}"
wget -c --no-verbose -O /tmp/ndk_armv6_${NDK_ARMV6_VERSION}.zip https://dl.google.com/android/repository/android-ndk-r${NDK_ARMV6_VERSION}-linux-x86_64.zip
unzip -qq /tmp/ndk_armv6_${NDK_ARMV6_VERSION}.zip -d $BUILD_DIR
}
if [ ! -e "${NDK_FLAGFILE}" ]; then
createNDKFolder

42
android/ci_build_libs_cmake.sh Executable file
View File

@ -0,0 +1,42 @@
#!/bin/sh
set -e
PLATFORM_NAME="android"
if [ ! -d "$PLATFORM_NAME" ]; then
echo "start this script in the source root directory"
exit 1
fi
BUILD_DIR="$PWD/3rdParty/$PLATFORM_NAME"
VCPKG_ROOT="$BUILD_DIR/vcpkg"
VCPKG_PORTS="$PWD/3rdParty/vcpkg_ports"
. $PLATFORM_NAME/ndk_common.sh
if [ ! -d $NDK_ROOT ]; then
createNDKFolder
fi
if [ ! -d $NDK_ARMV6_ROOT ]; then
createNDKARMV6Folder
fi
$PLATFORM_NAME/bootstrap_vcpkg_cmake.sh
./_autosetup
TRIPLETS_LIST="armv6-android arm-android arm-neon-android arm64-android x86-android x64-android"
for TRIPLET in $TRIPLETS_LIST ; do
echo "\e[0;35m building $TRIPLET ... \e[0m"
if [ "$TRIPLET" = "armv6-android" ]; then
export ANDROID_NDK_HOME=$NDK_ARMV6_ROOT
else
export ANDROID_NDK_HOME=$NDK_ROOT
fi
BUILD_TRIPLET=build-$TRIPLET
cmake lib -B $BUILD_TRIPLET -DCMAKE_TOOLCHAIN_FILE=$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake -DVCPKG_OVERLAY_PORTS=$VCPKG_PORTS/ports -DVCPKG_OVERLAY_TRIPLETS=$VCPKG_PORTS/triplets/ci -DVCPKG_TARGET_TRIPLET=$TRIPLET -DVCPKG_MANIFEST_DIR=lib/vcpkg_config_android -DVCPKG_INSTALL_OPTIONS=--clean-after-build
cmake --build $BUILD_TRIPLET
echo "\e[1;32m $TRIPLET done \e[0m"
done

20
android/ndk_common.sh Normal file
View File

@ -0,0 +1,20 @@
#!/bin/sh
export NDK_VERSION=21d
export NDK_ARMV6_VERSION=15c
export NDK_ROOT=$BUILD_DIR/android-ndk-r${NDK_VERSION}
export NDK_ARMV6_ROOT=$BUILD_DIR/android-ndk-r${NDK_ARMV6_VERSION}
createNDKFolder()
{
rm -rf "$BUILD_DIR/android-ndk-r${NDK_VERSION}"
wget -c --no-verbose -O /tmp/ndk_${NDK_VERSION}.zip https://dl.google.com/android/repository/android-ndk-r${NDK_VERSION}-linux-x86_64.zip
unzip -qq /tmp/ndk_${NDK_VERSION}.zip -d $BUILD_DIR
}
createNDKARMV6Folder()
{
rm -rf "$BUILD_DIR/android-ndk-r${NDK_ARMV6_VERSION}"
wget -c --no-verbose -O /tmp/ndk_armv6_${NDK_ARMV6_VERSION}.zip https://dl.google.com/android/repository/android-ndk-r${NDK_ARMV6_VERSION}-linux-x86_64.zip
unzip -qq /tmp/ndk_armv6_${NDK_ARMV6_VERSION}.zip -d $BUILD_DIR
}

View File

@ -0,0 +1,15 @@
{
"name": "boinc-libs",
"version-string": "7.19.0",
"builtin-baseline":"bd1ef2df46303989eeb048eb7aa9b816aa46365e",
"dependencies":
[
"openssl"
],
"overrides": [
{
"name": "openssl",
"version-string": "1.1.1n"
}
]
}