jbagg / QtZeroConf

Qt wrapper class for ZeroConf libraries across various platforms.
Other
69 stars 51 forks source link

Fix build issues and create APK for the Android with Qt6 #65

Open hancerli opened 5 months ago

hancerli commented 5 months ago

Build with Qt 6.7.0 and tested on;

jbagg commented 5 months ago

Hi, I have not used cmake from either the command line or with QtCreator to build an android target. I'm able to build the exe in QtCreator and from the cmd line, but not the apk. I cloned your fork and opened CMakeList.txt in QtCreator. build output is 09:41:22: Starting: "/usr/bin/cmake" --build /tmp/QtZeroConf/build-example-Android_Qt_6_5_1_6_5_1_Android_arm_Clang_armeabi_v7a-Debug --target all [1/5 5.7/sec] Automatic MOC and UIC for target QtZeroConfExample [2/5 2.2/sec] Building CXX object CMakeFiles/QtZeroConfExample.dir/QtZeroConfExample_autogen/mocs_compilation.cpp.o [3/5 3.2/sec] Building CXX object CMakeFiles/QtZeroConfExample.dir/main.cpp.o [4/5 3.7/sec] Building CXX object CMakeFiles/QtZeroConfExample.dir/window.cpp.o [5/5 4.5/sec] Linking CXX executable QtZeroConfExample 09:41:23: The process "/usr/bin/cmake" exited normally. 09:41:23: Cannot set up "Build Android APK", not building an APK. Error while building/deploying project QtZeroConfExample (kit: Android Qt 6.5.1 (6.5.1-Android-arm) Clang armeabi-v7a) When executing step "Build Android APK"

hancerli commented 5 months ago

You're using Qt 6.5.1 but I added Android support only for 6.6.x and later. Should I fail the Cmake (configure) if it's lower than that?

jbagg commented 5 months ago

template T QJniObject::object() was not added until Qt6.7, so your change would require 6.7 or later. This commit would break Qt 6.0 to 6.6.3. Does the QtZeroConf library not compile in Qt 6.7? I am not able to test as Qt 6.7 does not build on Debian 12; 6.6.3 does build, and QtZeroConf compiles fine with 6.6.3 as is.

hancerli commented 5 months ago

No it didn't built. Let me check.

hancerli commented 5 months ago

Fix the build issues.

jbagg commented 5 months ago

It doesn't seem right that Qt 6.7 would not compile code that Qt 6.6 does. I suspect something is still wrong. If you want to go ahead with this change, can you make the commits atomic? It is unclear to me why the changes in CMakeList are necessary to fix compiling and why openssl is needed. QtZeroConf and the example both compile with cmake and qmake as is.