Correct way to use QT_ANDROID_EXTRA_LIBS
-
I have an application based on Qt using latest Qt 6.2 beta. I'm trying to build an Android apk on Windows but the scripts are not including the required shared libraries to the apk. The only ones that I can see are the Qt ones. The code looks something like this:
find_package(dep1 CONFIG REQUIRED) qt_add_executable(app_name ${SRCS}) target_link_libraries(CloudCompanionStandalone PUBLIC dep1)
The only way to do it is by adding the dependencies manually:
set_property(TARGET app_name PROPERTY QT_ANDROID_EXTRA_LIBS "full/path/to/dep1.so")
This works but I can imagine that the paths can be extracted from target properties somehow instead of adding them manually which is rather fragile. Note that some of the dependencies are built within the same project and others are supplied with vcpkg.
-
Looks like this is tracked here https://bugreports.qt.io/browse/QTBUG-94714?jql=text ~ QT_ANDROID_EXTRA_LIBS ORDER BY created DESC
With a proposed solution here https://codereview.qt-project.org/c/qt/qtbase/+/365396