Closed juha-h closed 2 years ago
The develop branch was currently tested with some specific Android and iOS build. For Android build the gradle build file sets up the necessary variables such as the Android CPU. Code snippet of the gradle build file that we use:
externalNativeBuild {
// For ndk-build, instead use the ndkBuild block.
cmake {
// Passes optional arguments to CMake. Make sure it is a list, not just a string :-) .
arguments += listOf(
"-DANDROID_STL=c++_shared",
"-DANDROID=true",
"-DSQLCIPHER=true",
...
)
...
If you call the ZRTP cmake without the gradle Android build then you need to set (select one of the architectures):
-DANDROID -DANDROID_ABI=x86_64|x86|armeabi-v7a|arm64-v8a
This should work. We have not yet fully tested the develop branch for standalone builds. Also do not enable SIDH. This algorithm is broken and we are currently removing it from the code.
Thanks for your reply. I'm currently using master branch (core lib only) and the lib works fine with my baresip based open source Android app. I just thought to give try to develop branch, since master has not been updated for a while.
The error came, with this kind of cmake call:
CMAKE_ANDROID_FLAGS := \
-DANDROID=ON \
-DCMAKE_SYSTEM_NAME=Android \
-DCMAKE_SYSTEM_VERSION=$(API_LEVEL) \
-DCMAKE_TOOLCHAIN_FILE=$(CMAKE_TOOLCHAIN_FILE) \
-DANDROID_ABI=${ANDROID_TARGET_ARCH} \
-DCMAKE_ANDROID_ARCH_ABI=$(ANDROID_TARGET_ARCH) \
-DCMAKE_SKIP_INSTALL_RPATH=ON \
-DCMAKE_C_COMPILER=$(CC) \
-DCMAKE_CXX_COMPILER=$(CXX) \
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
cmake .. $(CMAKE_ANDROID_FLAGS)
where $(ANDROID_TARGET_ARCH)
has value arm64-v8a
.
I'll keep on trying.
When cmake starts, it prints:
-- Android: Targeting API '21' with architecture 'arm64', ABI 'arm64-v8a', and processor 'aarch64'
but these values don't reach botan build, because it prints:
INFO: CXX environment variable is set which will override compiler path
INFO: Implicit --cc-bin=/opt/Android/ndk/23.1.7779620/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android21-clang++ due to environment variable CXX
INFO: Autodetected platform information: OS="Linux" machine="x86_64" proc=""
INFO: Guessing target OS is linux (use --os to set)
INFO: Guessing target processor is a x86_64 (use --cpu to set)
Only environment variable CXX is detected.
Thanks for the feedback, I'll check this.
Regarding the master branch: there were no changes with regard to ZRTP protocol or alike. The current develop branch will be a large change with some new build system stuff, removing old code, cleanup etc. However, the interface to the application will have some small/minor changes only, mainly how ZrtpConfigure is used and some extensions to the ZrtpCache code.
I tried to build develop branch and it failed like this:
From build dir I found this:
How can I set ANDROID_ARCH? I have tried
-DANDROID_ARCH=aarch64-linux-android
cmake flag, but it didn't help.