qmake SUBDIRS and Qt libraries dependencies
I have quite complex project divided on libraries.
In qmake file I'm using SUBDIRS template, more-less like this:
SUBDIRS = src/lib1\ src/lib2\ src/main\
mainthere are files for android build and I'm adding the libraries with the following statement:
ANDROID_EXTRA_LIBS += $$OUT_PWD/lib1.so\ $$OUT_PWD/lib2.so\
All works fine, Android apk is built correctly.
The problem occurs when some library, i.e.
lib1depends on Qt module that
mainapplication library doesn't.
Concretely, lib1 uses QtNetwork mod but main doesn't
In that case the application crashes during launch due to unable to load QtNetwork lib (even if I'm trying to add it with
ANDROID_EXTRA_LIBSand apk contains it).
My workaround for it is to add some dummy method in
main(never called) that uses something from QtNetwork mod. This way all works.
So, is there any better way ?
Thank You for the answer and sorry for my late response....
SUBDIRS documentation was quite interesting but a solution is rather not there.
To properly load all dependencies during launching under Android, the apk has to have the list of them and
androiddeployqtis responsible for that.
I dig its doc and found
ANDROID_DEPLOYMENT_DEPENDENCIESvariable which can overwrite the list of libs automatically detected by
androiddeployqtbut I have to take responsibility to put there all dependencies in proper order.
I will try so...