aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuli Piippo <samuli.piippo@qt.io>2022-08-11 17:45:20 +0000
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-08-15 12:59:01 +0000
commitfa46e269e37bdee9269dda03e402c9f9c38c9a6f (patch)
tree7d18a92a01378a632724bb406efdcfe3d1a4d184
parenta565bccb0722fa3f76de4aa33c0f1d4cdc819a0b (diff)
sdk: rework how QT_HOST_PATH is set in sdk
After qtbase change 0f8017efb6d037c4f33f947eb3c56aeafa28313c, QT_HOST_PATH is no longer set in qt.toolchain.cmake, but it was moved to Qt6 package cmake files. Since the package is in target sysroot, we can no longer use its location to determine the absolute path of the host sysroot. Instead, resolve QT_HOST_PATH now in the CMake subscripts and use them also without the environment-setup script from Qt6Toolchain.cmake. Change-Id: I81d908321c0d05ab589b9340a62a45800e936252 Reviewed-by: Mikko Gronoff <mikko.gronoff@qt.io> (cherry picked from commit 0b55d8ec947e80a7781144013e2c62426b509624) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--classes/populate_sdk_qt6_base.bbclass7
-rw-r--r--recipes-qt/qt6/qtbase/0004-Fix-qt.toolchain.cmake-for-SDK-use.patch37
-rw-r--r--recipes-qt/qt6/qtbase_git.bb3
3 files changed, 16 insertions, 31 deletions
diff --git a/classes/populate_sdk_qt6_base.bbclass b/classes/populate_sdk_qt6_base.bbclass
index d66db42..af1e501 100644
--- a/classes/populate_sdk_qt6_base.bbclass
+++ b/classes/populate_sdk_qt6_base.bbclass
@@ -130,7 +130,12 @@ if(NOT DEFINED CMAKE_INSTALL_PREFIX)
set(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT 1)
endif()
set(CMAKE_INSTALL_PREFIX "${prefix}" CACHE PATH "Install path prefix")
-set(QT_BUILD_INTERNALS_NO_FORCE_SET_INSTALL_PREFIX ON CACHE BOOL "")
+
+# Include the toolchain configuration subscripts
+file( GLOB toolchain_config_files "\${CMAKE_CURRENT_LIST_DIR}/OEToolchainConfig.cmake.d/*.cmake" )
+foreach(config \${toolchain_config_files})
+ include(\${config})
+endforeach()
EOF
# resolve absolute paths at runtime
diff --git a/recipes-qt/qt6/qtbase/0004-Fix-qt.toolchain.cmake-for-SDK-use.patch b/recipes-qt/qt6/qtbase/0004-Fix-qt.toolchain.cmake-for-SDK-use.patch
index 4e2e3e9..b5f3459 100644
--- a/recipes-qt/qt6/qtbase/0004-Fix-qt.toolchain.cmake-for-SDK-use.patch
+++ b/recipes-qt/qt6/qtbase/0004-Fix-qt.toolchain.cmake-for-SDK-use.patch
@@ -1,38 +1,17 @@
-From a1729a003f820289c403360d43f10b7f84c5a03c Mon Sep 17 00:00:00 2001
-From: Janne Juntunen <janne.juntunen@qt.io>
-Date: Tue, 2 Aug 2022 11:03:08 +0300
-Subject: [PATCH] Fix qt toolchain for SDK use
-
-Set initial host path based on the location of the
-QtConfigDependencies.cmake.in file. This helps us avoid need to relocate
-the file in SDK.
+From a4d3698a56665cc73a18fa860c862e1b04533792 Mon Sep 17 00:00:00 2001
+From: Samuli Piippo <samuli.piippo@qt.io>
+Date: Thu, 16 Dec 2021 13:10:48 +0200
+Subject: [PATCH] Fix qt.toolchain.cmake for SDK use
The calculated paths for QT_TOOLCHAIN_RELOCATABLE paths point to
host sysroot which must not be used when cross-compiling other projects.
-Change-Id: I8d23f76e6e7abb2651b414661304ad58e5edd522
+Change-Id: I52aa2a10d2a13fd27d6bf8b4af6dc1833c7a286a
+Upstream-Status: Inappropriate [embedded specific]
---
- cmake/QtConfigDependencies.cmake.in | 6 ++++--
- cmake/qt.toolchain.cmake.in | 4 ++--
- 2 files changed, 6 insertions(+), 4 deletions(-)
+ cmake/qt.toolchain.cmake.in | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
-diff --git a/cmake/QtConfigDependencies.cmake.in b/cmake/QtConfigDependencies.cmake.in
-index c17ae28bac..4cc804c27a 100644
---- a/cmake/QtConfigDependencies.cmake.in
-+++ b/cmake/QtConfigDependencies.cmake.in
-@@ -1,8 +1,10 @@
- set(@INSTALL_CMAKE_NAMESPACE@_FOUND FALSE)
-
- set(__qt_platform_requires_host_info_package "@platform_requires_host_info_package@")
--set(__qt_platform_initial_qt_host_path "@qt_host_path_absolute@")
--set(__qt_platform_initial_qt_host_path_cmake_dir "@qt_host_path_cmake_dir_absolute@")
-+get_filename_component(__qt_toolchain_initial_qt_host_path
-+ "${CMAKE_CURRENT_LIST_DIR}/.." ABSOLUTE)
-+get_filename_component(__qt_toolchain_initial_qt_host_path_cmake_dir
-+ "${CMAKE_CURRENT_LIST_DIR}/../lib/cmake" ABSOLUTE)
-
- _qt_internal_setup_qt_host_path(
- "${__qt_platform_requires_host_info_package}"
diff --git a/cmake/qt.toolchain.cmake.in b/cmake/qt.toolchain.cmake.in
index 15cf7a432e..03de9288df 100644
--- a/cmake/qt.toolchain.cmake.in
diff --git a/recipes-qt/qt6/qtbase_git.bb b/recipes-qt/qt6/qtbase_git.bb
index ffff5bd..dfb7e9e 100644
--- a/recipes-qt/qt6/qtbase_git.bb
+++ b/recipes-qt/qt6/qtbase_git.bb
@@ -162,8 +162,9 @@ do_install:append() {
do_install:append:class-nativesdk() {
install -d ${D}${datadir}/cmake/OEToolchainConfig.cmake.d
+ RELPATH=${@os.path.relpath(d.getVar('prefix'), d.getVar('datadir') + '/cmake/OEToolchainConfig.cmake.d')}
cat > ${D}${datadir}/cmake/OEToolchainConfig.cmake.d/OEQt6Toolchain.cmake <<EOF
-set(QT_HOST_PATH "\$ENV{OECORE_NATIVE_SYSROOT}/usr" CACHE PATH "")
+get_filename_component(QT_HOST_PATH "\${CMAKE_CURRENT_LIST_DIR}/${RELPATH}" ABSOLUTE CACHE)
set(QT_BUILD_INTERNALS_NO_FORCE_SET_INSTALL_PREFIX ON CACHE BOOL "")
EOF