Cross compiling Qt 6.4.2 with wayland support for raspberry pi 4 qtwayland-everywhere
-
Hi,
I am cross compiling qt 6.4.2 with wayalnd support on a x86 for raspberry pi 4.
I have downloaded qt core and qtwayland-everywhere-src-6.4.2 plugin source.tldr: I have what looks like a qml dependency issue when compiling qtwayland-everywhere for the host. See error message at bottom.
I have use this guide as a start https://wiki.qt.io/Cross-Compile_Qt_6_for_Raspberry_Pi
I have configured and compiled 6.4.2 for the host and the target.
I needed to cherry pick to solve a missing define on qt coreI have the following directory structure with build directories and install dirs for host and target for bot the core and sub modules along with my toolchain.
├── qt6 │ ├── host │ ├── qt-host │ ├── qt-host2 │ ├── qt-hostbuild │ ├── qt-hostbuild_bkp │ ├── qt-raspi │ ├── qt-raspi2 │ ├── qtbase │ ├── qtpi-build │ ├── qtpi-build2 │ ├── src │ └── submodules │ ├── qtwayland-everywhere-src-6.4.2 │ ├── qtwayland-everywhere-src-6.4.2_hostbuild │ └── qtwayland-everywhere-src-6.4.2_rpibuild ├── rPi4_OS ├── rpi-sysroot │ ├── lib -> usr/lib/ │ └── usr └── toolchain └── aarch64--glibc--stable-2021.11-1
Host configure configure
cmake ../qtbase/ -GNinja -DCMAKE_BUILD_TYPE=Release -DQT_BUILD_EXAMPLES=OFF -DQT_BUILD_TESTS=OFF -DCMAKE_INSTALL_PREFIX=$CROSSCOMPILE/qt6/qt-host
I tried adding wayland to this host configure with
cmake ../qtbase/ -GNinja -DCMAKE_BUILD_TYPE=Release -DQT_BUILD_EXAMPLES=OFF -DQT_BUILD_TESTS=OFF -DCMAKE_INSTALL_PREFIX=$CROSSCOMPILE/qt6/qt-host -DBUILD_qtwayland=ON -DFEATURE_xcb=OFF
but I get the warning
CMake Warning: Manually-specified variables were not used by the project: BUILD_qtwayland
for target the config is
../qtbase/configure -release -opengl es2 -nomake examples -nomake tests -qt-host-path $CROSSCOMPILE/qt6/qt-host2 -extprefix $CROSSCOMPILE/qt6/qt-raspi2 -prefix /usr/local/qt6 -device linux-rasp-pi4-aarch64 -device-option CROSS_COMPILE=aarch64-linux-gnu- -submodules qtwayland -- -DCMAKE_TOOLCHAIN_FILE=$CROSSCOMPILE/toolchain.cmake -DQT_FEATURE_kms=ON -DQT_FEATURE_opengles2=ON -DQT_FEATURE_opengles3=ON
Compile and install goes fine.
I now try and configure and build qtwayland-everywhere.
Host configure
cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DQT_BUILD_EXAMPLES=OFF -DQT_BUILD_TESTS=OFF -DCMAKE_INSTALL_PREFIX=$CROSSCOMPILE/qt6/qt-host2
I had to add to CMakeLists.txt
include_directories($ENV{CROSSCOMPILE}/rpi-sysroot/usr/include/crossCompileInclude/vulkan/)
include_directories($ENV{CROSSCOMPILE}/rpi-sysroot/usr/include/crossCompileInclude/)
Which is the copy of the vulkan headers.
config works ok and gives me the following config, which I don't know if this is enough for the host?
Qt Wayland TextInput Protocol V4(WIP) .... no Qt Wayland Client ........................ yes Qt Wayland Compositor .................... yes Qt Wayland Drivers: EGL .................................... yes Raspberry Pi ........................... no DRM EGL ................................ yes libhybris EGL .......................... no Linux dma-buf server buffer integration no Shm emulation server buffer integration yes Vulkan-based server buffer integration . no Qt Wayland Client Shell Integrations: xdg-shell .............................. yes ivi-shell .............................. yes wl-shell (deprecated) .................. yes qt-shell ............................... yes Qt Wayland Compositor Layer Plugins: VSP2 hardware layer integration ........ no
I then try and build but get the following error
[121/471] Generating .rcc/qmlcache/WaylandCompositor_qmlfiles/WaylandCursorItem_qml.cpp Warning: WaylandCursorItem.qml:44:13: no matching signal found for handler "onOffsetForNextFrame" onOffsetForNextFrame: dragIcon.offset = offset; ^^^^^^^^^^^^^^^^^^^^ Info: Implicitly defining onOffsetForNextFrame as signal handler in Connections is deprecated. Create a function instead function onOffsetForNextFrame() { ... } ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Warning: WaylandCursorItem.qml:25:9: no matching signal found for handler "onCursorSurfaceRequest" onCursorSurfaceRequest: { ^^^^^^^^^^^^^^^^^^^^^^ Info: Implicitly defining onCursorSurfaceRequest as signal handler in Connections is deprecated. Create a function instead function onCursorSurfaceRequest() { ... } ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Error: WaylandCursorItem.qml:13:25: Could not compile binding for visible: Cannot generate efficient code for equality comparison on non-primitive types QJSValue of QJSValue and QJSValue of QWaylandQuickItem::surface with type QWaylandSurface visible: cursorItem.surface != null ^^^^^^^
which I have no idea about. Looks like some kind of dependency issue but I have no idea with qml. Any guidance appreciated.
-
P.S. an idea how to get the config to active the Qt Wayland driver for raspberry pi? Or does it do this only when building the target qt targeted at the pi? I can't find any documentation about put what option to put into
configure
orqt-configure-module
it pure luck of finding a forum post and looking at others options so if anyone has any documentation for this it would be great.Qt Wayland Drivers: EGL .................................... yes Raspberry Pi ........................... no