CMake: Write host architecture and ABI to qconfig.pri

...when cross-building Qt.

Change-Id: I7d2fe83167fc278fde9f0c0fd70f5fa42fa62862
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
Joerg Bornemann 2020-06-26 14:58:06 +02:00
parent 2299b61d0c
commit 5ccecd3a89
2 changed files with 19 additions and 2 deletions

View File

@ -1157,9 +1157,24 @@ function(qt_generate_global_config_pri_file)
")
endif()
string(APPEND content "QT_ARCH = ${TEST_architecture_arch}
if(CMAKE_CROSSCOMPILING)
string(APPEND content "host_build {
QT_ARCH = ${QT${PROJECT_VERSION_MAJOR}_HOST_INFO_ARCH}
QT_BUILDABI = ${QT${PROJECT_VERSION_MAJOR}_HOST_INFO_BUILDABI}
QT_TARGET_ARCH = ${TEST_architecture_arch}
QT_TARGET_BUILDABI = ${TEST_buildAbi}
} else {
QT_ARCH = ${TEST_architecture_arch}
QT_BUILDABI = ${TEST_buildAbi}
}
")
else()
string(APPEND content "QT_ARCH = ${TEST_architecture_arch}
QT_BUILDABI = ${TEST_buildAbi}
QT.global.enabled_features = ${corrected_enabled_features}
")
endif()
string(APPEND content "QT.global.enabled_features = ${corrected_enabled_features}
QT.global.disabled_features = ${corrected_disabled_features}
QT.global.disabled_features += release build_all
QT_CONFIG += ${qt_public_config_joined}

View File

@ -16,3 +16,5 @@ set(@var_prefix@EXAMPLESDIR "@INSTALL_EXAMPLESDIR@")
set(@var_prefix@TESTSDIR "@INSTALL_TESTSDIR@")
set(@var_prefix@DESCRIPTIONSDIR "@INSTALL_DESCRIPTIONSDIR@")
set(@var_prefix@QMAKE_MKSPEC "@QT_QMAKE_TARGET_MKSPEC@")
set(@var_prefix@ARCH "@TEST_architecture_arch@")
set(@var_prefix@BUILDABI "@TEST_buildAbi@")