diff options
author | Joerg Bornemann <joerg.bornemann@qt.io> | 2022-12-06 16:12:12 +0100 |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@qt.io> | 2022-12-09 16:16:49 +0100 |
commit | 1180d5b8a270cfe7bd1c501c892d1c38ee7425de (patch) | |
tree | d071aa18f222cde3456fbab53aea1382e31492f3 /cmake | |
parent | 8bffcdc52f9c83516f055290711a6369b307129f (diff) | |
download | qtbase-1180d5b8a270cfe7bd1c501c892d1c38ee7425de.tar.gz |
CMake: Add Android build information to generated module .json files
Qt Creator maintains a mapping from Qt version to Android NDK version
and other build information. It's simpler to let the Qt build write the
Android build information into modules/Core.json and have Qt Creator use
this information.
This adds the following properties to the module JSON files:
- built_with.android.api_version
- built_with.android.ndk.version
Task-number: QTBUG-108292
Change-Id: I0febda5192289c5afb1a098880b31bef6317db35
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/ModuleDescription.json.in | 2 | ||||
-rw-r--r-- | cmake/QtModuleHelpers.cmake | 10 |
2 files changed, 11 insertions, 1 deletions
diff --git a/cmake/ModuleDescription.json.in b/cmake/ModuleDescription.json.in index 6aae9a4a59..ab5f4e304a 100644 --- a/cmake/ModuleDescription.json.in +++ b/cmake/ModuleDescription.json.in @@ -1,7 +1,7 @@ { "module_name": "${target}", "version": "${PROJECT_VERSION}", - "built_with": { + "built_with": {${extra_build_information} "compiler_id": "${CMAKE_CXX_COMPILER_ID}", "compiler_target": "${CMAKE_CXX_COMPILER_TARGET}", "compiler_version": "${CMAKE_CXX_COMPILER_VERSION}", diff --git a/cmake/QtModuleHelpers.cmake b/cmake/QtModuleHelpers.cmake index 59340222bb..9a9e3bec1d 100644 --- a/cmake/QtModuleHelpers.cmake +++ b/cmake/QtModuleHelpers.cmake @@ -1021,6 +1021,16 @@ function(qt_describe_module target) if(CMAKE_CROSSCOMPILING) set(cross_compilation "true") endif() + set(extra_build_information "") + if(ANDROID) + string(APPEND extra_build_information " + \"android\": { + \"api_version\": \"${QT_ANDROID_API_VERSION}\", + \"ndk\": { + \"version\": \"${ANDROID_NDK_REVISION}\" + } + },") + endif() configure_file("${descfile_in}" "${descfile_out}") qt_install(FILES "${descfile_out}" DESTINATION "${install_dir}") |