aboutsummaryrefslogtreecommitdiff
path: root/toolchain/Android.cmake
diff options
context:
space:
mode:
authorVolker Krause <vkrause@kde.org>2022-02-11 19:13:47 +0100
committerVolker Krause <vkrause@kde.org>2022-02-11 19:14:37 +0100
commit676f90873b4d35c20976536844c36b8c0fbe06a5 (patch)
tree98663d3a5a4c04d7acf14c3fb1eebf292ef6ea36 /toolchain/Android.cmake
parent402903e5caa15f483193cd10d97754ea73078f0e (diff)
downloadextra-cmake-modules-676f90873b4d35c20976536844c36b8c0fbe06a5.tar.gz
extra-cmake-modules-676f90873b4d35c20976536844c36b8c0fbe06a5.tar.bz2
Adapt Android toolchain file and FindGradle to Qt6
- We don't need the Threads target workaround anymore, that breaks the build with Qt6 even. - The Gradle wrapper shipped with Qt is no longer installed as executable, so we need to run this in sh explicitly. - Qt6 uses a different Android Gradle plugin version (not to be confused with the Gradle version), which we need to make available for the configure_file() call on the build.gradle file. With this most Framework modules build against Qt6 here.
Diffstat (limited to 'toolchain/Android.cmake')
-rw-r--r--toolchain/Android.cmake6
1 files changed, 5 insertions, 1 deletions
diff --git a/toolchain/Android.cmake b/toolchain/Android.cmake
index 5a48464c..280f129d 100644
--- a/toolchain/Android.cmake
+++ b/toolchain/Android.cmake
@@ -179,7 +179,11 @@ endif()
# armv7 really doesn't like mixing PIC/PIE code.
# Since we only have to care about a single compiler,
# hard-code the values here.
-if (NOT TARGET Threads::Threads)
+# Qt6 fixes this and breaks if we define Threads::Threads here.
+# We cannot use our usual Qt version check at this point though yet,
+# se check whether we are chainloaded by the Qt toolchain as an indicator
+# for Qt6.
+if (NOT TARGET Threads::Threads AND NOT DEFINED __qt_chainload_toolchain_file)
set(Threads_FOUND TRUE)
set(CMAKE_THREAD_LIBS_INIT "-pthread")
add_library(Threads::Threads INTERFACE IMPORTED)