summaryrefslogtreecommitdiffstats
path: root/cmake/QtBuild.cmake
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2020-07-03 11:18:52 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2020-07-09 11:56:26 +0200
commitd5e8a5d9cbcebec966833155728be3f2d293aafa (patch)
tree45dc8cbe269150cdba0f4feff8c6755e70d39afa /cmake/QtBuild.cmake
parentdb397d11130639abae1b1438b0685db2c75db330 (diff)
CMake: Fix missing qdevice.pri values and qt.conf info for Android
qdevice.pri should embed info about the Android SDK, NDK, host, platform api level and ABI. The machine tuple test should not be run for uikit and Android platforms. Sysroot should also not be prepended for uikit and Android platforms, otherwise it breaks Qt module include paths. Task-number: QTBUG-85399 Task-number: QTBUG-82581 Change-Id: Ic48c88f6ab15d75c2ebc323c8d7a3b7e5596f3c1 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'cmake/QtBuild.cmake')
-rw-r--r--cmake/QtBuild.cmake31
1 files changed, 29 insertions, 2 deletions
diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake
index f2418303c6..80eceab27a 100644
--- a/cmake/QtBuild.cmake
+++ b/cmake/QtBuild.cmake
@@ -1260,9 +1260,28 @@ function(qt_generate_global_device_pri_file)
string(APPEND content "${opt}\n")
endforeach()
+ # Write android specific device info.
+ if(ANDROID)
+ string(APPEND content "DEFAULT_ANDROID_SDK_ROOT = ${ANDROID_SDK_ROOT}\n")
+ string(APPEND content "DEFAULT_ANDROID_NDK_ROOT = ${ANDROID_NDK}\n")
+
+ set(android_platform "android-23")
+ if(ANDROID_NATIVE_API_LEVEL)
+ set(android_platform "android-${ANDROID_NATIVE_API_LEVEL}")
+ endif()
+ string(APPEND content "DEFAULT_ANDROID_PLATFORM = ${android_platform}\n")
+
+ string(APPEND content "DEFAULT_ANDROID_NDK_HOST = ${ANDROID_HOST_TAG}\n")
+
+ # TODO: QTBUG-80943 When we eventually support Android multi-abi, this should be changed.
+ string(APPEND content "DEFAULT_ANDROID_ABIS = ${ANDROID_ABI}\n")
+ endif()
+
+ set(gcc_machine_dump "")
if(TEST_machine_tuple)
- string(APPEND content "GCC_MACHINE_DUMP = ${TEST_machine_tuple}\n")
+ set(gcc_machine_dump "${TEST_machine_tuple}")
endif()
+ string(APPEND content "GCC_MACHINE_DUMP = ${gcc_machine_dump}\n")
file(GENERATE OUTPUT "${qdevice_pri_target_path}" CONTENT "${content}")
qt_install(FILES "${qdevice_pri_target_path}" DESTINATION ${INSTALL_MKSPECSDIR})
@@ -1430,12 +1449,20 @@ Prefix=${ext_prefix_relative_to_conf_file}
")
endif()
+ # On Android CMAKE_SYSROOT is set, but for Qt's purposes it should not be set, because then
+ # qmake generates incorrect Qt module include flags (among other things). Do the same for darwin
+ # cross-compilation.
+ set(sysroot "")
+ if(CMAKE_SYSROOT AND NOT ANDROID AND NOT UIKIT)
+ set(sysroot "${CMAKE_SYSROOT}")
+ endif()
+
string(APPEND content
"[Paths]
Prefix=${ext_prefix_relative_to_conf_file}
HostPrefix=${host_prefix_relative_to_conf_file}
HostData=${ext_prefix_relative_to_host_prefix}
-Sysroot=${CMAKE_SYSROOT}
+Sysroot=${sysroot}
SysrootifyPrefix=${sysrootify_prefix}
TargetSpec=${QT_QMAKE_TARGET_MKSPEC}
HostSpec=${QT_QMAKE_HOST_MKSPEC}