aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuli Piippo <samuli.piippo@qt.io>2021-12-17 14:55:56 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-01-11 16:41:18 +0000
commiteb0a848094732918df40b315c9199ec142f4d3e5 (patch)
tree7f8fe438fedbd4dce1ea3f8e2c824d5cd217f88b
parentb1ca57e68adef1e1b799df6175bdbfa4d4fff626 (diff)
sdk: use Qt's own qt.toolchain.cmake in build scriptsv6.3.0-alpha
qt-cmake* helper build scripts by default use Qt's generated qt.toolchain.cmake as the CMAKE_TOOLCHAIN_FILE. Keep this behavior and patch qt.toolchain.cmake so that will chain-load our Qt6Toolchain.cmake. qt.toolchain.cmake includes bits that are needed for the conan integration to work correctly with the sdk. Change-Id: I89a5e152324178151ba8a5ab4734d542fa4c995c Reviewed-by: Mikko Gronoff <mikko.gronoff@qt.io> (cherry picked from commit 7f3cb3884d844cfe578fae43f0cf02694b98487a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--classes/populate_sdk_qt6_base.bbclass12
-rw-r--r--recipes-qt/qt6/qtbase/0004-Do-not-use-QT_TOOLCHAIN_RELOCATABLE-paths-in-qt.tool.patch29
-rw-r--r--recipes-qt/qt6/qtbase_git.bb7
3 files changed, 35 insertions, 13 deletions
diff --git a/classes/populate_sdk_qt6_base.bbclass b/classes/populate_sdk_qt6_base.bbclass
index a792159..e7cc4d3 100644
--- a/classes/populate_sdk_qt6_base.bbclass
+++ b/classes/populate_sdk_qt6_base.bbclass
@@ -96,15 +96,9 @@ set(CMAKE_TOOLCHAIN_FILE "${SDKPATHNATIVE}/usr/share/cmake/OEToolchainConfig.cma
include("\${CMAKE_TOOLCHAIN_FILE}")
EOF
- # override qt-cmake
- cat > ${SDK_OUTPUT}${SDKPATHNATIVE}${QT6_INSTALL_BINDIR}/qt-cmake <<EOF
-#!/bin/sh
-
-cmake_path="${SDKPATHNATIVE}${bindir}/cmake"
-toolchain_path="${SDKPATHNATIVE}/usr/share/cmake/Qt6Toolchain.cmake"
-exec "\$cmake_path" -DCMAKE_TOOLCHAIN_FILE="\$toolchain_path" "\$@"
-EOF
-
+ # and use that from the default toolchain file qt.toolchain.cmake
+ sed -i ${SDK_OUTPUT}${SDKPATHNATIVE}${QT6_INSTALL_LIBDIR}/cmake/Qt6/qt.toolchain.cmake \
+ -e 's|/.*/toolchain.cmake|${SDKPATHNATIVE}/usr/share/cmake/Qt6Toolchain.cmake|'
}
create_qt6_sdk_files:append:sdkmingw32() {
diff --git a/recipes-qt/qt6/qtbase/0004-Do-not-use-QT_TOOLCHAIN_RELOCATABLE-paths-in-qt.tool.patch b/recipes-qt/qt6/qtbase/0004-Do-not-use-QT_TOOLCHAIN_RELOCATABLE-paths-in-qt.tool.patch
new file mode 100644
index 0000000..7aa108e
--- /dev/null
+++ b/recipes-qt/qt6/qtbase/0004-Do-not-use-QT_TOOLCHAIN_RELOCATABLE-paths-in-qt.tool.patch
@@ -0,0 +1,29 @@
+From c15033fd4df14b08fc28ec8da61c990801c7e411 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] Do not use QT_TOOLCHAIN_RELOCATABLE paths in
+ qt.toolchain.cmake
+
+The calculated paths for QT_TOOLCHAIN_RELOCATABLE paths point to
+host sysroot which must not be used when cross-compiling other projects.
+
+Upstream-Status: Inappropriate [embedded specific]
+---
+ cmake/qt.toolchain.cmake.in | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/cmake/qt.toolchain.cmake.in b/cmake/qt.toolchain.cmake.in
+index 5e9acd66b8..451de99633 100644
+--- a/cmake/qt.toolchain.cmake.in
++++ b/cmake/qt.toolchain.cmake.in
+@@ -68,8 +68,8 @@ get_filename_component(QT_TOOLCHAIN_RELOCATABLE_CMAKE_DIR "${CMAKE_CURRENT_LIST_
+ # Instead of collapsing the search prefix (which is the case when one is a subdir of the other),
+ # it concatenates them creating an invalid path. Workaround it by setting the root path to the
+ # Qt install prefix, and the prefix path to the lib/cmake subdir.
+-list(PREPEND CMAKE_PREFIX_PATH "${QT_TOOLCHAIN_RELOCATABLE_CMAKE_DIR}")
+-list(PREPEND CMAKE_FIND_ROOT_PATH "${QT_TOOLCHAIN_RELOCATABLE_INSTALL_PREFIX}")
++#list(PREPEND CMAKE_PREFIX_PATH "${QT_TOOLCHAIN_RELOCATABLE_CMAKE_DIR}")
++#list(PREPEND CMAKE_FIND_ROOT_PATH "${QT_TOOLCHAIN_RELOCATABLE_INSTALL_PREFIX}")
+
+ # Let CMake load our custom platform modules.
+ # CMake-provided platform modules take precedence.
diff --git a/recipes-qt/qt6/qtbase_git.bb b/recipes-qt/qt6/qtbase_git.bb
index 88e9682..fa44b08 100644
--- a/recipes-qt/qt6/qtbase_git.bb
+++ b/recipes-qt/qt6/qtbase_git.bb
@@ -17,6 +17,7 @@ SRC_URI += "\
file://0001-Add-linux-oe-g-platform.patch \
file://0002-qlibraryinfo-allow-to-set-qt.conf-from-the-outside-u.patch \
file://0003-tests-disable-failing-tests.patch \
+ file://0004-Do-not-use-QT_TOOLCHAIN_RELOCATABLE-paths-in-qt.tool.patch \
file://0001-catch_p_p.h-don-t-use-MINSIGSTKSZ.patch \
"
@@ -154,10 +155,8 @@ set(QT_HOST_PATH "\$ENV{OECORE_NATIVE_SYSROOT}/usr" CACHE PATH "")
set(QT_BUILD_TOOLS_WHEN_CROSSCOMPILING "TRUE" CACHE BOOL "")
EOF
- sed -i ${D}${QT6_INSTALL_BINDIR}/* \
- -e 's|${RECIPE_SYSROOT_NATIVE}|${SDKPATHNATIVE}|' \
- -e '/^toolchain_path=/s|.*|toolchain_path=${SDKPATHNATIVE}/usr/share/cmake/Qt6Toolchain.cmake|'
-
+ sed -i ${D}${QT6_INSTALL_BINDIR}/* ${D}${QT6_INSTALL_LIBDIR}/cmake/Qt6/qt.toolchain.cmake \
+ -e 's|${RECIPE_SYSROOT_NATIVE}|${SDKPATHNATIVE}|'
}
INSANE_SKIP:${PN}-ptest += "arch"