[build,android] only use CMake from SDK

* only use CMake from android SDK
* abort if CMake or ndk-build are not detected
This commit is contained in:
Armin Novak 2023-02-08 07:48:49 +01:00 committed by Martin Fleisz
parent db98f16e5b
commit 8ca386a300
2 changed files with 29 additions and 21 deletions

View File

@ -8,11 +8,11 @@ case "$(uname -s)" in
Darwin)
FIND_ARGS="-perm +111 $FIND_ARGS"
;;
;;
*)
FIND_ARGS="-executable $FIND_ARGS"
;;
;;
esac
if [ -z $BUILD_ARCH ]; then
@ -96,10 +96,10 @@ function common_parse_arguments {
do
key="$1"
case $key in
--conf)
source "$2" || exit 1
shift
;;
--conf)
source "$2" || exit 1
shift
;;
--target)
NDK_TARGET="$2"
@ -217,12 +217,20 @@ function common_check_requirements {
else
echo "ndk-build not found in NDK directory $ANDROID_NDK"
echo "assuming ndk-build is in path..."
NDK_BUILD=ndk-build
NDK_BUILD=$(which ndk-build)
if [ -z $NDK_BUILD ]; then
echo "ndk-build not found in $ANDROID_NDK and not in PATH"
exit 1
fi
fi
if [ -z $CMAKE_PROGRAM ]; then
CMAKE_PROGRAM=$(find $ANDROID_SDK/cmake -name cmake $FIND_ARGS)
fi
if [ -z $CMAKE_PROGRAM ]; then
CMAKE_PROGRAM=$(find $ANDROID_SDK/cmake -name cmake $FIND_ARGS)
if [ -z $CMAKE_PROGRAM ]; then
echo "CMake not found in $ANDROID_SDK, install CMake from the android SDK!"
exit 1
fi
fi
for CMD in make git $CMAKE_PROGRAM $NDK_BUILD
do

View File

@ -173,17 +173,17 @@ do
# Build and install the library.
if [ $DEPS_ONLY -eq 0 ];
then
common_run cd $BASE
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_PROGRAM $CMAKE_CMD_ARGS \
-DANDROID_ABI=$ARCH \
-DCMAKE_INSTALL_PREFIX=$BUILD_DST/$ARCH \
-DCMAKE_INSTALL_LIBDIR=. \
$SRC_DIR
echo $(pwd)
common_run cmake --build . --target install
common_run cd $BASE
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_PROGRAM $CMAKE_CMD_ARGS \
-DANDROID_ABI=$ARCH \
-DCMAKE_INSTALL_PREFIX=$BUILD_DST/$ARCH \
-DCMAKE_INSTALL_LIBDIR=. \
$SRC_DIR
echo $(pwd)
common_run $CMAKE_PROGRAM --build . --target install
fi
done