App-LabRecorder
App-LabRecorder copied to clipboard
Compile the non-Qt-parts for Android
Hopefully, https://github.com/labstreaminglayer/liblsl-Android/pull/1, https://github.com/labstreaminglayer/liblsl-Android/pull/2 and the newer Android toolchain work well enough together we can tackle compiling the (non-Qt) parts of LabRecorder for Android.
Using ninja, the latest version (important) of cmake and the android sdk and ndk, I am able to get LabRecorder to compile with
c:\labstreaminglayer\build>cmake .. -G "Ninja" -DQt5_DIR="C:/Qt5.12.0/5.12.0/android_armv7/lib/cmake/Qt5" -DCMAKE_SYSTEM_NAME=Android -DCMAKE_ANDROID_NDK="c:/AndroidStudio/android-sdk/ndk-bundle" -DIS_LITTLE_ENDIAN=TRUE -DCMAKE_ANDROID_ARCH_ABI=armeabi-v7a -DCMAKE_ANDROID_NDK_TOOLCHAIN_VERSION=clang -DCMAKE_ANDROID_STL_TYPE=c++_shared -DLSLAPPS_Labrecorder=ON
c:\labstreaminglayer\build>cmake --build . --config Release
I had to remove
if (MINGW)
target_link_libraries (${target} PUBLIC ws2_32 wsock32 winmm)
endif()
from LSL/libllsl/CMakeLists.txt. This should be removed permanently, right? No one should be linking boost libraries anymore.
It doesn't build an apk though, just a jumble of build products. Perhaps next I will attempt to build it inside of Android Studio instead.
Older versions of the android ndk fail due to missing features, such as std::to_string and std::make_unique. Older versions of CMake fail because the newest android ndk deprecated a bunch of features.
http://doc.qt.io/qt-5/deployment-android.html gives some hints about how to bundle qt android applications. They only use Android Studio to get the ndk and sdk.
For further commentary on Qt with Android, see Issue#3.