add script to build with Android NDK

This commit is contained in:
Benjamin Sergeant 2020-05-26 15:15:45 -07:00
parent 3a020a66b7
commit 9ddf707804
2 changed files with 37 additions and 3 deletions

View File

@ -37,9 +37,7 @@ if (USE_MBED_TLS)
target_include_directories(ixcrypto PUBLIC ${MBEDTLS_INCLUDE_DIRS}) target_include_directories(ixcrypto PUBLIC ${MBEDTLS_INCLUDE_DIRS})
target_link_libraries(ixcrypto ${MBEDTLS_LIBRARIES}) target_link_libraries(ixcrypto ${MBEDTLS_LIBRARIES})
target_compile_definitions(ixcrypto PUBLIC IXCRYPTO_USE_MBED_TLS) target_compile_definitions(ixcrypto PUBLIC IXCRYPTO_USE_MBED_TLS)
elseif (APPLE) elseif (USE_OPEN_SSL)
elseif (WIN32)
else()
find_package(OpenSSL REQUIRED) find_package(OpenSSL REQUIRED)
add_definitions(${OPENSSL_DEFINITIONS}) add_definitions(${OPENSSL_DEFINITIONS})
message(STATUS "OpenSSL: " ${OPENSSL_VERSION}) message(STATUS "OpenSSL: " ${OPENSSL_VERSION})

36
tools/build_android.sh Normal file
View File

@ -0,0 +1,36 @@
#!/bin/sh
#
# Executable : ${HOME}/Android/Sdk/cmake/3.6.3155560/bin/cmake
# arguments :
# -H${HOME}/Dev/github-projects/googlesamples/android-ndk/hello-jni/app/src/main/cpp
# -B${HOME}/Dev/github-projects/googlesamples/android-ndk/hello-jni/app/.cxx/cmake/arm7Debug/armeabi-v7a
# -GAndroid Gradle - Ninja
# -DANDROID_ABI=armeabi-v7a
# -DANDROID_NDK=${HOME}/Android/Sdk/ndk-bundle
# -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=${HOME}/Dev/github-projects/googlesamples/android-ndk/hello-jni/app/build/intermediates/cmake/arm7/debug/obj/armeabi-v7a
# -DCMAKE_BUILD_TYPE=Debug
# -DCMAKE_MAKE_PROGRAM=${HOME}/Android/Sdk/cmake/3.6.3155560/bin/ninja
# -DCMAKE_TOOLCHAIN_FILE=${HOME}/Android/Sdk/ndk-bundle/build/cmake/android.toolchain.cmake
# -DANDROID_NATIVE_API_LEVEL=23
# -DANDROID_TOOLCHAIN=clang
# jvmArgs :
#
CMAKE_TOOLCHAIN_FILE=/tools/android/android-ndk-r20-darwin/build/cmake/android.toolchain.cmake
ANDROID_HOME=/tools/android/android-sdk-darwin
ANDROID_NDK=${ANDROID_HOME}/ndk-bundle
CMAKE_DIR=${ANDROID_HOME}/cmake/3.10.2.4988404/bin
CMAKE=${CMAKE_DIR}/cmake
NINJA=${CMAKE_DIR}/ninja
${CMAKE} \
.. \
-DANDROID_NATIVE_API_LEVEL=23 \
-DANDROID_ABI=armeabi-v7a \
-DANDROID_TOOLCHAIN=clang \
-DANDROID_NDK=${ANDROID_NDK} \
-G'Unix Makefiles' \
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} \
-DCMAKE_MAKE_PROGRAM=make \
-DUSE_WS=1