Skip to content

Fix building "executables" on Android with Qt 6

Building executables without exported symbols (e.g. unit tests) works fine, but for APKs we need the entry point exported. And that in turn requires everything to be built with PIC. That is the case in Qt 5, as that is unconditionally forced on everything. With Qt 6 that is not necessarily the case for executables though, and then CMake only gives us PIE by default, which is not enough. Fix this by turning PIE into PIC.

This does not fix building actual APKs yet, ECMAndroidDeployQt has yet to be ported for that.

Merge request reports