aboutsummaryrefslogtreecommitdiffstats
path: root/sources
diff options
context:
space:
mode:
authorShyamnath Premnadh <Shyamnath.Premnadh@qt.io>2025-11-11 09:57:47 +0100
committerShyamnath Premnadh <Shyamnath.Premnadh@qt.io>2025-11-11 11:07:09 +0100
commit541fa28ad2f61cda0170c73eb740b77f20b9b8cc (patch)
treed9d869d954c9d93cff482cba7cfcff512a72a9cb /sources
parent0fbdc6362523d724034b95304fcb3810cf3090f9 (diff)
PySide6-Android: Use ANDROID_API_VERSION for SDK jar location
- For Java packaging, use ANDROID_API_VERSION environment variable if set, otherwise fall back to CMAKE_ANDROID_API. This enables supporting the CI which sets ANDROID_API_VERSION to 36 and also local builds using the latest API level supported by the NDK. - Added a small comment as to why Qt for Python builds can use API level of 35 as opposed to Qt which uses 28. Pick-to: 6.10 6.10.1 Change-Id: Id5cb2d5c6ab235b365c26da79b5e65bbe30c81e9 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'sources')
-rw-r--r--sources/pyside-tools/cmake/PySideAndroid.cmake12
1 files changed, 9 insertions, 3 deletions
diff --git a/sources/pyside-tools/cmake/PySideAndroid.cmake b/sources/pyside-tools/cmake/PySideAndroid.cmake
index d89da4f1b..37b38805f 100644
--- a/sources/pyside-tools/cmake/PySideAndroid.cmake
+++ b/sources/pyside-tools/cmake/PySideAndroid.cmake
@@ -20,10 +20,16 @@ macro(create_and_install_qt_javabindings)
${android_main_srcs}/QtService.java
)
# set android.jar from the sdk, for compiling the java files into .jar
- set(sdk_jar_location "${ANDROID_SDK_ROOT}/platforms/android-${CMAKE_ANDROID_API}/android.jar")
- file(GLOB sources_list LIST_DIRECTORIES true "${ANDROID_SDK_ROOT}/platforms/android-${CMAKE_ANDROID_API}/*")
+ # Use ANDROID_API_VERSION from environment if set, otherwise fall back to CMAKE_ANDROID_API
+ if(DEFINED ENV{ANDROID_API_VERSION})
+ set(ANDROID_SDK_API_LEVEL "$ENV{ANDROID_API_VERSION}")
+ else()
+ set(ANDROID_SDK_API_LEVEL "android-${CMAKE_ANDROID_API}")
+ endif()
+ set(sdk_jar_location "${ANDROID_SDK_ROOT}/platforms/${ANDROID_SDK_API_LEVEL}/android.jar")
+ file(GLOB sources_list LIST_DIRECTORIES true "${ANDROID_SDK_ROOT}/platforms/${ANDROID_SDK_API_LEVEL}/*")
if (NOT EXISTS "${sdk_jar_location}")
- message(FATAL_ERROR "Could not locate Android SDK jar for api '${CMAKE_ANDROID_API}' - ${sdk_jar_location}")
+ message(FATAL_ERROR "Could not locate Android SDK jar for api '${ANDROID_SDK_API_LEVEL}' - ${sdk_jar_location}")
endif()
# this variable is accessed by qt_internal_add_jar