diff options
author | Samuli Piippo <samuli.piippo@qt.io> | 2022-06-09 07:51:07 +0000 |
---|---|---|
committer | Mikko Gronoff <mikko.gronoff@qt.io> | 2022-11-11 16:06:18 +0200 |
commit | 0144a4389c0bdd6bbcc303de3ba64b1b743f65bb (patch) | |
tree | 74151ffaa5576ac0ab65369f23b05a0253cf9108 /recipes-qt | |
parent | 9fd87589f70e8dfaf505d96750dd952de996f245 (diff) |
ptest: fix build issue with qtbase tests
ptest build had a subtle problem with qtbase where it was using
Qt6BuildInternals package from native sysroot instead of the target
install path. This could add compiler flags that were not supported
for the target architecture:
cc1plus: error: '-fcf-protection=full' is not supported for this target
QT_ADDITIONAL_PACKAGES_PREFIX_PATH is not used in qtbase/CMakeLists.txt:
find_package(Qt6 REQUIRED COMPONENTS BuildInternals CMAKE_FIND_ROOT_PATH_BOTH)
so the current approach for using Qt from the install path was not working.
Change the ptest build from using QT_ADDITIONAL_PACKAGES_PREFIX_PATHs
to using separate cmake toolchain file that prepends the install path
to CMAKE_FIND_ROOT_PATH, which makes CMake find the target Qt packages
correctly.
Change-Id: Idc99a26577886208b85bafe811f61538bb38d5bc
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit b6a93fbdb6074d7578904a69c7ce6adeff38481f)
Diffstat (limited to 'recipes-qt')
-rw-r--r-- | recipes-qt/qt6/qt6-ptest.inc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/recipes-qt/qt6/qt6-ptest.inc b/recipes-qt/qt6/qt6-ptest.inc index d68e17d..6eaa041 100644 --- a/recipes-qt/qt6/qt6-ptest.inc +++ b/recipes-qt/qt6/qt6-ptest.inc @@ -11,6 +11,11 @@ DEBUG_PREFIX_MAP += "\ " fakeroot do_install_ptest() { + cat >${WORKDIR}/toolchain-ptest.cmake <<EOF +include(${WORKDIR}/toolchain.cmake) +list(PREPEND CMAKE_FIND_ROOT_PATH ${D}) +EOF + if [ -n "${OE_QMAKE_QMAKE}" ]; then # qmake project B_PTEST=${B} @@ -25,13 +30,13 @@ fakeroot do_install_ptest() { cd ${B_PTEST} cmake \ ${OECMAKE_GENERATOR_ARGS} \ - -DCMAKE_TOOLCHAIN_FILE=${WORKDIR}/toolchain.cmake \ + -DCMAKE_TOOLCHAIN_FILE=${WORKDIR}/toolchain-ptest.cmake \ -DPython3_EXECUTABLE=${PYTHON} \ ${EXTRA_OECMAKE} \ -DQT_BUILD_STANDALONE_TESTS=ON \ - -DQT_ADDITIONAL_PACKAGES_PREFIX_PATH="${D}${QT6_INSTALL_LIBDIR}/cmake;${RECIPE_SYSROOT}/${QT6_INSTALL_LIBDIR}/cmake" \ -DCMAKE_STAGING_PREFIX=${D}${prefix} \ -DCMAKE_SKIP_RPATH=ON \ + -DQT_DISABLE_NO_DEFAULT_PATH_IN_QT_PACKAGES=ON \ ${S} \ -Wno-dev ${CMAKE_VERBOSE} cmake --build ${B_PTEST} --target all |