From: akallabeth Date: Wed, 8 Apr 2020 14:58:19 +0000 (+0200) Subject: Use cmake from NDK X-Git-Tag: 2.0.0~23 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fd9b5463a07185d352b430f6ac21b91626ef6aaf;p=platform%2Fupstream%2Ffreerdp.git Use cmake from NDK --- diff --git a/scripts/android-build-common.sh b/scripts/android-build-common.sh index 9ca85a4..11fda67 100644 --- a/scripts/android-build-common.sh +++ b/scripts/android-build-common.sh @@ -11,6 +11,10 @@ if [ -z $NDK_TARGET ]; then NDK_TARGET=21 fi +if [ -z $CMAKE_PROGRAM ]; then + CMAKE_PROGRAM=$(find $ANDROID_SDK/cmake -name cmake -type f -executable -print -quit) +fi + if [ -z $CCACHE ]; then CCACHE=$(which ccache) fi @@ -19,6 +23,10 @@ if [ -z $ANDROID_NDK ]; then ANDROID_NDK="missing" fi +if [ -z $ANDROID_SDK ]; then + ANDROID_SDK="missing" +fi + if [ -z $BUILD_DST ]; then BUILD_DST=$(pwd)/libs fi @@ -41,6 +49,8 @@ function common_help { echo "$(BASHSOURCE[0]) supports the following arguments:" echo " --ndk The base directory of your android NDK defa" echo " ANDROID_NDK=$ANDROID_NDK" + echo " --sdk The base directory of your android SDK defa" + echo " ANDROID_SDK=$ANDROID_SDK" echo " --arch A list of architectures to build" echo " BUILD_ARCH=$BUILD_ARCH" echo " --dst The destination directory for include and library files" @@ -87,6 +97,12 @@ function common_parse_arguments { shift ;; + --sdk) + ANDROID_SDK="$2" + CMAKE_PROGRAM=$(find $ANDROID_SDK/cmake -name cmake -type f -executable -print -quit) + shift + ;; + --arch) BUILD_ARCH="$2" shift @@ -136,6 +152,11 @@ function common_check_requirements { exit 1 fi + if [[ ! -d $ANDROID_SDK ]]; + then + echo "export ANDROID_SDK to point to your SDK location." + exit 1 + fi if [[ -z $BUILD_DST ]]; then echo "Destination directory not valid" @@ -174,13 +195,11 @@ function common_check_requirements { NDK_BUILD=ndk-build fi - if [[ -z $NDK_BUILD ]]; - then - echo "Android ndk-build not detected" - exit 1 - fi + if [ -z $CMAKE_PROGRAM ]; then + CMAKE_PROGRAM=$(find $ANDROID_SDK/cmake -name cmake -type f -executable -print -quit) + fi - for CMD in make git cmake $NDK_BUILD + for CMD in make git $CMAKE_PROGRAM $NDK_BUILD do if ! type $CMD >/dev/null; then echo "Command $CMD not found. Install and add it to the PATH." diff --git a/scripts/android-build-freerdp.sh b/scripts/android-build-freerdp.sh index b7569bf..b27fa6c 100755 --- a/scripts/android-build-freerdp.sh +++ b/scripts/android-build-freerdp.sh @@ -140,7 +140,7 @@ do common_run mkdir -p $BUILD_SRC/freerdp-build/$ARCH common_run cd $BUILD_SRC/freerdp-build/$ARCH common_run export ANDROID_NDK=$ANDROID_NDK - common_run cmake $CMAKE_CMD_ARGS \ + common_run $CMAKE_PROGRAM $CMAKE_CMD_ARGS \ -DANDROID_ABI=$ARCH \ -DCMAKE_INSTALL_PREFIX=$BUILD_DST/$ARCH \ -DCMAKE_INSTALL_LIBDIR=. \