[BUILD] crosscompile fail
I want to build for iMX8M CPU.
I wrote a crossfile for that arch following those instructions, under ubuntu 20.04.
The toolchain was installed using a yocto generated package, which provide a shell to be sourced before building.
I call this command to launch configuration :
meson --buildtype debugoptimized --cross-file cross-file.txt --reconfigure --fatal-meson-warnings waypipe build-waypipe-imx8
I found strange that the host machine is still x86_64 but at least it is detecting a crosscompile and the crosscompiler. Then I launch the build but it fails : it is adding an include to the build machine path.
To me it is because of tha t-I/usr/include which will relate to the build machine FS.
That include is the result of a pkg-config call.
From the meson log I identified :
Called /home/nautilus/Yocto/fslc-xwayland/3.3/sysroots/x86_64-fslcsdk-linux/usr/bin/pkg-config --variable=includedir libdrm
-> 0
/usr/include
Got pkgconfig variable includedir : /usr/include
I don't know why and how it found a pkg in that path. of course the path is invalid.At least is should provide the path prepended with that sysroot. If search a little bit and this can be done by adding --define-prefix option.
since I'm not familiar with meson, with some change I coud fix it :
libdrm_include_dir = run_command('pkg-config', '--variable=includedir', '--define-prefix', 'libdrm').stdout().strip()
waypipe_includes += include_directories(libdrm_include_dir)
That change may not be the most elegant way to do that though. That is why I am not proposing a pull request. Probably the change should be done for the other dependencies not found by pkg. I am not sure the crossfile is useful because I had the crossbuild info positionned without it.
Best regards.