Skip to content

Commit

Permalink
Android: remove unused qt_get_android_sdk_jar_for_api() function
Browse files Browse the repository at this point in the history
This function is no longer needed after removing the one unnecessary
use for it in qtspeech.

Change-Id: Ia0d061e898aedff0ba6941b678e0ec45a1abe55d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
  • Loading branch information
Issam-b committed Dec 7, 2024
1 parent d08b558 commit faec1a0
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 21 deletions.
12 changes: 0 additions & 12 deletions cmake/QtPlatformAndroid.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,6 @@ if (NOT IS_DIRECTORY "${ANDROID_SDK_ROOT}")
message(FATAL_ERROR "Could not find ANDROID_SDK_ROOT or path is not a directory: ${ANDROID_SDK_ROOT}")
endif()

# Get the Android SDK jar for an API version other than the one specified with
# QT_ANDROID_API_USED_FOR_JAVA.
function(qt_get_android_sdk_jar_for_api api out_jar_location)
set(jar_location "${ANDROID_SDK_ROOT}/platforms/${api}/android.jar")
if (NOT EXISTS "${jar_location}")
message(WARNING "Could not locate Android SDK jar for api '${api}', defaulting to ${QT_ANDROID_API_USED_FOR_JAVA}")
set(${out_jar_location} ${QT_ANDROID_JAR} PARENT_SCOPE)
else()
set(${out_jar_location} ${jar_location} PARENT_SCOPE)
endif()
endfunction()

# This variable specifies the API level used for building Java code, it can be the same as Qt for
# Android's maximum supported Android version or higher.
set(QT_ANDROID_API_USED_FOR_JAVA "android-34")
Expand Down
10 changes: 1 addition & 9 deletions util/cmake/pro2cmake.py
Original file line number Diff line number Diff line change
Expand Up @@ -3798,20 +3798,12 @@ def write_jar(cm_fh: IO[str], scope: Scope, *, indent: int = 0) -> str:
raise RuntimeError("Could not locate jar install path")
install_dir = install_dir.replace("$$[QT_INSTALL_PREFIX]/", "")

android_sdk_jar = "${QT_ANDROID_JAR}"
android_api_level = scope.get_string("API_VERSION")
if android_api_level:
cm_fh.write(
f'{spaces(indent)}qt_get_android_sdk_jar_for_api("{android_api_level}" android_sdk)\n\n'
)
android_sdk_jar = "${android_sdk}"

write_source_file_list(
cm_fh, scope, "", ["JAVASOURCES"], indent=indent, header="set(java_sources\n", footer=")\n"
)

cm_fh.write(f"{spaces(indent)}qt_internal_add_jar({target}\n")
cm_fh.write(f"{spaces(indent+1)}INCLUDE_JARS {android_sdk_jar}\n")
cm_fh.write(f"{spaces(indent+1)}INCLUDE_JARS ${{QT_ANDROID_JAR}}\n")
cm_fh.write(f"{spaces(indent+1)}SOURCES ${{java_sources}}\n")
cm_fh.write(f'{spaces(indent+1)}OUTPUT_DIR "${{QT_BUILD_DIR}}/{install_dir}"\n')
cm_fh.write(f"{spaces(indent)})\n\n")
Expand Down

0 comments on commit faec1a0

Please sign in to comment.