-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b623143
commit 8bb8ac0
Showing
8 changed files
with
144 additions
and
252 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
.github/scripts/patches/qt6androidmacros_build_tools_revision.diff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
Description: Qt6 tries to allow setting the build tools revision via | ||
QT_ANDROID_SDK_BUILD_TOOLS_REVISION, but fails to actually return it from this | ||
function that's supposed to determine the version to use. This leads to it | ||
generating an invalid gradle.properties file with a blank entry for the build | ||
tools version. This patch fixes that function to actually return the version | ||
properly. | ||
|
||
--- a/src/corelib/Qt6AndroidMacros.cmake | ||
+++ b/src/corelib/Qt6AndroidMacros.cmake | ||
@@ -5,7 +5,9 @@ | ||
|
||
# Locate newest Android sdk build tools revision | ||
function(_qt_internal_android_get_sdk_build_tools_revision out_var) | ||
- if (NOT QT_ANDROID_SDK_BUILD_TOOLS_REVISION) | ||
+ if (QT_ANDROID_SDK_BUILD_TOOLS_REVISION) | ||
+ set(${out_var} "${QT_ANDROID_SDK_BUILD_TOOLS_REVISION}") | ||
+ else() | ||
file(GLOB android_build_tools | ||
LIST_DIRECTORIES true | ||
RELATIVE "${ANDROID_SDK_ROOT}/build-tools" | ||
@@ -17,8 +19,8 @@ | ||
list(SORT android_build_tools) | ||
list(REVERSE android_build_tools) | ||
list(GET android_build_tools 0 android_build_tools_latest) | ||
+ set(${out_var} "${android_build_tools_latest}" PARENT_SCOPE) | ||
endif() | ||
- set(${out_var} "${android_build_tools_latest}" PARENT_SCOPE) | ||
endfunction() | ||
|
||
# The function appends to the 'out_var' a 'json_property' that contains the 'tool' path. If 'tool' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
From 27321bb7fae0f82cf069cea74438278d4706feb7 Mon Sep 17 00:00:00 2001 | ||
From: Ville Voutilainen <[email protected]> | ||
Date: Sun, 18 Aug 2024 01:59:29 +0300 | ||
Subject: [PATCH] Fix an evaluated use of std::declval in qjnitypes.h | ||
|
||
While other compilers don't seem to have trouble with this, the latest | ||
NDK (27) compiler does. That compiler diagnoses the empty-pack case, even though in that case there is no actual use of declval, as the pack-expanded expression contains no use of declval. | ||
For other compilers, that may work for functions that have no arguments, but will not work for any function that does have arguments; in that case, the attempt to use declval will always be ill-formed, and there will be an attempt to use declval. | ||
|
||
The fix is straightforward; we have a Ret(*)(Args...), its return type | ||
is simply Ret. So use a simple trait instead of the result of a call. | ||
|
||
Task-number: QTBUG-127468 | ||
Change-Id: I0dc9e1201914ab94acc2940870be7c6d8cb16c12 | ||
Reviewed-by: Thiago Macieira <[email protected]> | ||
(cherry picked from commit 236c6ec6f4c777d0534539f1c293cfc74006a6eb) | ||
Reviewed-by: Qt Cherry-pick Bot <[email protected]> | ||
(cherry picked from commit 1079d210d19cc05275228a17c318e5bdbcdeff6c) | ||
--- | ||
|
||
diff --git a/src/corelib/kernel/qjnitypes.h b/src/corelib/kernel/qjnitypes.h | ||
index 4317f75..5e07547 100644 | ||
--- a/src/corelib/kernel/qjnitypes.h | ||
+++ b/src/corelib/kernel/qjnitypes.h | ||
@@ -123,12 +123,14 @@ | ||
return makeTupleFromArgsHelper<Args...>(args); | ||
} | ||
|
||
-// Get the return type of a function point | ||
-template <typename Ret, typename ...Args> | ||
-auto nativeFunctionReturnType(Ret(*function)(Args...)) | ||
+template <typename> | ||
+struct NativeFunctionReturnType {}; | ||
+ | ||
+template<typename Ret, typename... Args> | ||
+struct NativeFunctionReturnType<Ret(Args...)> | ||
{ | ||
- return function(std::declval<Args>()...); | ||
-} | ||
+ using type = Ret; | ||
+}; | ||
|
||
} // namespace Detail | ||
} // namespace QtJniMethods | ||
@@ -139,7 +141,7 @@ | ||
// the actual function with. This then takes care of implicit conversions, | ||
// e.g. a jobject becomes a QJniObject. | ||
#define Q_DECLARE_JNI_NATIVE_METHOD_HELPER(Method) \ | ||
-static decltype(QtJniMethods::Detail::nativeFunctionReturnType(Method)) \ | ||
+static QtJniMethods::Detail::NativeFunctionReturnType<decltype(Method)>::type \ | ||
va_##Method(JNIEnv *env, jclass thiz, ...) \ | ||
{ \ | ||
va_list args; \ |
Oops, something went wrong.