Use cmake from NDK
This commit is contained in:
parent
1c77db0a94
commit
fd9b5463a0
@ -11,6 +11,10 @@ if [ -z $NDK_TARGET ]; then
|
|||||||
NDK_TARGET=21
|
NDK_TARGET=21
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -z $CMAKE_PROGRAM ]; then
|
||||||
|
CMAKE_PROGRAM=$(find $ANDROID_SDK/cmake -name cmake -type f -executable -print -quit)
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -z $CCACHE ]; then
|
if [ -z $CCACHE ]; then
|
||||||
CCACHE=$(which ccache)
|
CCACHE=$(which ccache)
|
||||||
fi
|
fi
|
||||||
@ -19,6 +23,10 @@ if [ -z $ANDROID_NDK ]; then
|
|||||||
ANDROID_NDK="missing"
|
ANDROID_NDK="missing"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -z $ANDROID_SDK ]; then
|
||||||
|
ANDROID_SDK="missing"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -z $BUILD_DST ]; then
|
if [ -z $BUILD_DST ]; then
|
||||||
BUILD_DST=$(pwd)/libs
|
BUILD_DST=$(pwd)/libs
|
||||||
fi
|
fi
|
||||||
@ -41,6 +49,8 @@ function common_help {
|
|||||||
echo "$(BASHSOURCE[0]) supports the following arguments:"
|
echo "$(BASHSOURCE[0]) supports the following arguments:"
|
||||||
echo " --ndk The base directory of your android NDK defa"
|
echo " --ndk The base directory of your android NDK defa"
|
||||||
echo " ANDROID_NDK=$ANDROID_NDK"
|
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 " --arch A list of architectures to build"
|
||||||
echo " BUILD_ARCH=$BUILD_ARCH"
|
echo " BUILD_ARCH=$BUILD_ARCH"
|
||||||
echo " --dst The destination directory for include and library files"
|
echo " --dst The destination directory for include and library files"
|
||||||
@ -87,6 +97,12 @@ function common_parse_arguments {
|
|||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
--sdk)
|
||||||
|
ANDROID_SDK="$2"
|
||||||
|
CMAKE_PROGRAM=$(find $ANDROID_SDK/cmake -name cmake -type f -executable -print -quit)
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
|
||||||
--arch)
|
--arch)
|
||||||
BUILD_ARCH="$2"
|
BUILD_ARCH="$2"
|
||||||
shift
|
shift
|
||||||
@ -136,6 +152,11 @@ function common_check_requirements {
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ ! -d $ANDROID_SDK ]];
|
||||||
|
then
|
||||||
|
echo "export ANDROID_SDK to point to your SDK location."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
if [[ -z $BUILD_DST ]];
|
if [[ -z $BUILD_DST ]];
|
||||||
then
|
then
|
||||||
echo "Destination directory not valid"
|
echo "Destination directory not valid"
|
||||||
@ -174,13 +195,11 @@ function common_check_requirements {
|
|||||||
NDK_BUILD=ndk-build
|
NDK_BUILD=ndk-build
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -z $NDK_BUILD ]];
|
if [ -z $CMAKE_PROGRAM ]; then
|
||||||
then
|
CMAKE_PROGRAM=$(find $ANDROID_SDK/cmake -name cmake -type f -executable -print -quit)
|
||||||
echo "Android ndk-build not detected"
|
fi
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
for CMD in make git cmake $NDK_BUILD
|
for CMD in make git $CMAKE_PROGRAM $NDK_BUILD
|
||||||
do
|
do
|
||||||
if ! type $CMD >/dev/null; then
|
if ! type $CMD >/dev/null; then
|
||||||
echo "Command $CMD not found. Install and add it to the PATH."
|
echo "Command $CMD not found. Install and add it to the PATH."
|
||||||
|
@ -140,7 +140,7 @@ do
|
|||||||
common_run mkdir -p $BUILD_SRC/freerdp-build/$ARCH
|
common_run mkdir -p $BUILD_SRC/freerdp-build/$ARCH
|
||||||
common_run cd $BUILD_SRC/freerdp-build/$ARCH
|
common_run cd $BUILD_SRC/freerdp-build/$ARCH
|
||||||
common_run export ANDROID_NDK=$ANDROID_NDK
|
common_run export ANDROID_NDK=$ANDROID_NDK
|
||||||
common_run cmake $CMAKE_CMD_ARGS \
|
common_run $CMAKE_PROGRAM $CMAKE_CMD_ARGS \
|
||||||
-DANDROID_ABI=$ARCH \
|
-DANDROID_ABI=$ARCH \
|
||||||
-DCMAKE_INSTALL_PREFIX=$BUILD_DST/$ARCH \
|
-DCMAKE_INSTALL_PREFIX=$BUILD_DST/$ARCH \
|
||||||
-DCMAKE_INSTALL_LIBDIR=. \
|
-DCMAKE_INSTALL_LIBDIR=. \
|
||||||
|
Loading…
Reference in New Issue
Block a user