Description
Describe the bug
Currently testing with Meson 3.1.0 and Qt 6.7.0-rc1 (but I checked that no changes were done to the Qt support in meson in later versions); qt6 is detected via pkg-config method.
For a cross-compilation setup in Yocto there are typically two different sysroots (names are arbitrary, but I use the Yocto names):
- recipe-sysroot: contains all *.pc files, headers and cross-compiled libraries for the target machine
- recipe-sysroot-native: contains usr/bin/... and further folder structures that provide access to host tools to be used during the compilation
I am currently trying to e.g. build appstream with qt support or GStreamer with Qt support and both fail to find all Qt6 compile time dependencies (rcc, moc, etc.). The reason is very obvious when looking into the pc files provided by Qt:
prefix=/usr
exec_prefix=${prefix}
bindir=${prefix}/bin
libexecdir=${prefix}/libexec
libdir=${prefix}/lib
includedir=${prefix}/include
Name: Qt6 Core
Description: Qt Core module
Version: 6.7.0
Libs: -L${libdir} -lQt6Core
Cflags: -I${includedir}/QtCore -I${includedir} -DQT_CORE_LIB
Requires: Qt6Platform
AFAIS pkg-config has no way to know where to look for the host tools, because there is only the PKG_CONFIG_SYSROOT_DIR variable available, which points to the target sysroot.
To Reproduce
Currently, "easiest" is to compile appstream in Yocto master and activate the qt flag there.
Expected behavior
That the pkg-config method finds qt6
This change is related to #9791 , because specifically the libexec path makes the situation complicated. I am looking for feedback how to handle such an situation best to get the libexec and bin paths actually rooted into the host tools sysroot.