[scripts] Set default PKG_CONFIG_PATH to help cross-compilation on Linux#51242
[scripts] Set default PKG_CONFIG_PATH to help cross-compilation on Linux#51242vserdyuk wants to merge 2 commits intomicrosoft:masterfrom
Conversation
No, it makes things worse: It adds host (x64) directories which are incompatible with target (arm64) binaries. What vcpkg would need is using a pkgconfig tool pre-configured for the target prefix/sysroot when building for the target (but not when building for the host!). It is probably possible to inject this via the triplet file. Some environment would provide a |
How is that? It adds The Qt binaries built with vcpkg are then used to cross-compile my project and it runs fine on target arm64 Ubuntu 24.04. Though maybe I'm missing some other cases for which this patch would actually make things worse. |
|
This is from /usr/lib/pkgconfig, but not arm64: (I do believe that it works for your Qt binaries. But IMO the suggested implementation is too specific for a particular case.) |
…ross-compilation on Linux
df426d0 to
27ee2ea
Compare
|
Now I see. On my system /usr/lib/pkgconfig was just empty. So I think we can just remove that. |
|
IMO the customization point is the triplet file (via "overlay triplets"). But things get interesting when you want the same in a top-level project and in manifest-mode dependencies. |
BillyONeal
left a comment
There was a problem hiding this comment.
I agree with @dg0yt that makes it too easy to accidentally depend on host bits.
|
Looks like setting only CI building qtbase failed last time probably because of missing arm64 system packages. The following works for me: |
|
... and it only reaches ports which use the CMake toolchain (CMake project mode). |
|
After discussion with @vicroms we have decided to close this. |
This fixes qtbase:arm64-linux on x64-linux host. Tested on Ubuntu 24.04.
Based on https://wiki.qt.io/Cross-Compile_Qt_6_for_Raspberry_Pi