From fe451151ab766ab3351f7bd7e88f2f75297382ed Mon Sep 17 00:00:00 2001 From: Michal Klocek Date: Sat, 28 Aug 2021 00:08:06 +0200 Subject: Disable examples compilation on qemu Cmake builds when cross compiling have 3 different sets of qt libs: * sysroot * host * staging ones (target) However unlike qmake cmake does not support rpath-link therefore libs during the linking can be resolved to the sysroot instead of staging (target) ones, meaning we compile against newer headers and link with older sysroot's lib. Luckily this only happens when cmake is not able to set full absolute path to the library in staging dir, which in turn depends on rpath of the library. If rpath start with ORIGIN cmake will make absolute path and all implicit dependency libs are pulled from that lib location. However, during examples builds libs for given module are not installed yet, meaning there is no ORIGIN in rpath libraries so no absolute path meaning that all implicit dependencies in result are pulled from sysroot. This leads to linker errors in best scenario or to faulty linked application. The workaround introduced in QTBUG-86533 is to add all implicit dependencies as explicit, but in case of webengine it means adding log list of implicit dependencies to every single example. Simply disable build of examples as workaround. Note tests are not currently affected by that issue on coin, since they are built after installing module libs, which is not the case for examples. Note this issue is affecting us now, since external project is gone and we do not install libs implicitly during module build stage. Task-number: QTBUG-86533 Change-Id: Ica29cffcfbfcf66912af60ba4f8e88eca3af6f78 Reviewed-by: Allan Sandfeld Jensen (cherry picked from commit 7d2a2bf1b022419872b9eac813afed112240631c --- examples/CMakeLists.txt | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'examples/CMakeLists.txt') diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index fcc2fa2c7..54e8d5006 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -1,16 +1,18 @@ cmake_minimum_required(VERSION 3.16) qt_examples_build_begin() -if(QT_FEATURE_qtwebengine_build AND QT_FEATURE_qtwebengine_quick_build) - add_subdirectory(webengine) -endif() -if(QT_FEATURE_qtwebengine_build AND QT_FEATURE_qtwebengine_widgets_build) - add_subdirectory(webenginewidgets) -endif() -if(QT_FEATURE_qtpdf_build AND QT_FEATURE_qtpdf_quick_build) - add_subdirectory(pdf) -endif() -if(QT_FEATURE_qtpdf_build AND QT_FEATURE_qtpdf_widgets_build) - add_subdirectory(pdfwidgets) +if(NOT CMAKE_CROSSCOMPILING) #QTBUG-86533 + if(QT_FEATURE_qtwebengine_build AND QT_FEATURE_qtwebengine_quick_build) + add_subdirectory(webengine) + endif() + if(QT_FEATURE_qtwebengine_build AND QT_FEATURE_qtwebengine_widgets_build) + add_subdirectory(webenginewidgets) + endif() + if(QT_FEATURE_qtpdf_build AND QT_FEATURE_qtpdf_quick_build) + add_subdirectory(pdf) + endif() + if(QT_FEATURE_qtpdf_build AND QT_FEATURE_qtpdf_widgets_build) + add_subdirectory(pdfwidgets) + endif() endif() qt_examples_build_end() -- cgit v1.2.3