meson
meson copied to clipboard
meson test with cross compile fails
I am building on Linux, cross compiling for i686-w64-mingw32. When running meson test I get the error
Meson test encountered an error:
The exe_wrapper defined in the cross file 'WINEPATH="/usr/i686-w64-mingw32/lib;/usr/lib/gcc/i686-w64-mingw32/10-win32" wine' was not found. Please check the command and/or add it to PATH.
My cross compile file is
[binaries]
c = '/usr/bin/i686-w64-mingw32-gcc'
cpp = '/usr/bin/i686-w64-mingw32-g++'
ar = '/usr/bin/i686-w64-mingw32-ar'
strip = '/usr/bin/i686-w64-mingw32-strip'
windres = '/usr/bin/i686-w64-mingw32-windres'
pkgconfig = '/usr/bin/i686-w64-mingw32-pkg-config'
exe_wrapper = 'WINEPATH="/usr/i686-w64-mingw32/lib;/usr/lib/gcc/i686-w64-mingw32/10-win32" wine'
[host_machine]
system = 'windows'
cpu_family = 'x86'
cpu = 'i686'
endian = 'little'
[properties]
needs_exe_wrapper = true
Initially I had exe_wrapper set to exe_wrapper = 'wine' but then I would get the following build error:
*** Building cairo ***
The Meson build system
Version: 0.56.2
Source dir: /home/adrian/cairo
Build dir: /home/adrian/build-i686-w64-mingw32/cairo
Build type: cross build
Program version.py found: YES (/home/adrian/cairo/version.py)
Project name: cairo
Project version: 1.17.4
C compiler for the host machine: /usr/bin/i686-w64-mingw32-gcc (gcc 10.0.0 "i686-w64-mingw32-gcc (GCC) 10-win32 20210110")
C linker for the host machine: /usr/bin/i686-w64-mingw32-gcc ld.bfd 2.35.2
002b:err:module:import_dll Library libgcc_s_dw2-1.dll (which is needed by L"Z:\\home\\adrian\\build-i686-w64-mingw32\\cairo\\meson-private\\sanitycheckcpp_cross.exe") not found
002b:err:module:LdrInitializeThunk Importing dlls for L"Z:\\home\\adrian\\build-i686-w64-mingw32\\cairo\\meson-private\\sanitycheckcpp_cross.exe" failed, status c0000135
../../..//cairo/meson.build:1:0: ERROR: Executables created by cpp compiler /usr/bin/i686-w64-mingw32-g++ are not runnable.
I added the WINEPATH to the exe_wrapper and that fixed the sanitycheckcpp_cross.exe problem. But it appears meson test does not like the WINEPATH in the exe_wrapper.
I tried removing the WINEPATH from the exe_wrapper and setting it in my environment before building with meson. Now when running `meson test cairo -v --num-processes 1 I get the error:
ninja: Entering directory `/home/adrian/build-i686-w64-mingw32/cairo'
ninja: no work to do.
002d:err:module:import_dll Library libpixman-1-0.dll (which is needed by L"Z:\\home\\adrian\\build-i686-w64-mingw32\\cairo\\test\\cairo-test-suite.exe") not found
002d:err:module:import_dll Library libfreetype-6.dll (which is needed by L"Z:\\home\\adrian\\BUIL~HOG\\cairo\\src\\libcairo-2.dll") not found
002d:err:module:import_dll Library libpixman-1-0.dll (which is needed by L"Z:\\home\\adrian\\BUIL~HOG\\cairo\\src\\libcairo-2.dll") not found
002d:err:module:import_dll Library libpng16.dll (which is needed by L"Z:\\home\\adrian\\BUIL~HOG\\cairo\\src\\libcairo-2.dll") not found
002d:err:module:import_dll Library zlib1.dll (which is needed by L"Z:\\home\\adrian\\BUIL~HOG\\cairo\\src\\libcairo-2.dll") not found
002d:err:module:import_dll Library libcairo-2.dll (which is needed by L"Z:\\home\\adrian\\build-i686-w64-mingw32\\cairo\\test\\cairo-test-suite.exe") not found
002d:err:module:LdrInitializeThunk Importing dlls for L"Z:\\home\\adrian\\build-i686-w64-mingw32\\cairo\\test\\cairo-test-suite.exe" failed, status c0000135
There's unfortunately no way to pass environment variables though the cross file directly. You can use a shell script wrapper for that purpose though.