Qt6: improve cross-compilation support, misc minor fixes #26565
+308
−224
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Changes to recipe: qt/6.x.x
Motivation
#26529 added the core logic that's necessary to cross-compiler the Qt6 recipe at all, but it still has some major limitations:
Qt6::moc
, this can either fail if these have not been built and are useless for consuming projects trying to use these tools.CMAKE_AUTOMOC_EXECUTABLE
etc. variables for CMake to find the correct build-context tools.Details
In addition to fixing the above issues, this PR also incorporates a few other fixes that I've accumulated in the process of improving cross-compilation support for all optional modules in Qt. These include:
made
force_build_tools
optional and False by default for cross-compilation, since they are generally not useful in that context and can have build issues:[1409/1453] Linking CXX executable qtbase/libexec/rcc
FAILED: qtbase/libexec/rcc
: && /usr/bin/aarch64-linux-gnu-g++-13 -DNDEBUG -O2 -Wl,-z,relro,-z,now -Wl,--enable-new-dtags -fPIE -pie qtbase/src/tools/rcc/CMakeFiles/rcc_native.dir/rcc_native_autogen/mocs_compilation.cpp.o qtbase/src/tools/rcc/CMakeFiles/rcc_native.dir/main.cpp.o qtbase/src/tools/rcc/CMakeFiles/rcc_native.dir/rcc.cpp.o -o qtbase/libexec/rcc -Wl,-rpath,/home/user/.conan2/p/b/qtc8d3483cfcb1b/b/build/Release/qtbase/lib: qtbase/lib/libQt6Core.so.6.8.2 && :
/usr/lib/gcc-cross/aarch64-linux-gnu/13/../../../../aarch64-linux-gnu/bin/ld: warning: libicudata.so.75, needed by /home/user/.conan2/p/b/icu9b438096da10d/p/lib/libicuuc.so.75, not found (try using -rpath or -rpath-link)
/usr/lib/gcc-cross/aarch64-linux-gnu/13/../../../../aarch64-linux-gnu/bin/ld: /home/user/.conan2/p/b/icu9b438096da10d/p/lib/libicuuc.so.75: undefined reference to `icudt75_dat'
collect2: error: ld returned 1 exit status
Dropped
cross_compile
andsysroot
options since these seem to be solely there as carry-overs from the Qt5 recipe this one was based on. These were effectively useless before the cross-compilation support and are unlikely to have ever been used. Thecross_compile
option has little value now that the recipe has cross-compilation support andsysroot
should use the value fromtools.build:sysroot
instead. These could be added back if someone sees a need for them.add missing
package_type
and a missingfPIC
option.Added an option for unity build, which can help with build times quite a bit. I did not remove it from package_id, though, since it can cause subtle differences in the built binaries.
Dropped some validation checks and workarounds which appear likely to be outdated or possibly only relevant for Conan v1.
Added a
transitive_libs=True
foropengl/system
.gssapi
/krb5
is now supported on CCI (although the exported .pc files are not correct: krb5: set pkg_config_name #25434).Added all executables built and installed by Qt to package() and refactored it a bit.
Improved the filtering for kept .cmake module files in package().
No need to remove *.la files for a CMake project.
Export
QT_HOST_PATH
andQT_HOST_PATH_CMAKE_DIR
env vars for host-context Qt. These are used to find the correct executables.