From 676f90873b4d35c20976536844c36b8c0fbe06a5 Mon Sep 17 00:00:00 2001 From: Volker Krause Date: Fri, 11 Feb 2022 19:13:47 +0100 Subject: 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. --- toolchain/Android.cmake | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'toolchain') 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) -- cgit v1.2.1