Add shell script and cross-compilation file to compile Harfbuzz with meson

This commit is contained in:
Vincent Torri 2020-05-21 19:53:42 +02:00 committed by Ebrahim Byagowi
parent d2e3a048d1
commit 8ba0077ea3
2 changed files with 50 additions and 0 deletions

17
meson-mingw-cross.txt Normal file
View File

@ -0,0 +1,17 @@
[binaries]
c = '@host@-gcc'
cpp = '@host@-g++'
ar = '@host@-ar'
ranlib = '@host@-ranlib'
strip = '@host@-strip'
windres = '@host@-windres'
pkgconfig = 'pkg-config'
[host_machine]
system = 'windows'
cpu_family = '@cpu@'
cpu = '@cpu@'
endian = 'little'
[properties]
cpp_args = ['-D_WIN32_WINNT=0x0601', '-O2', '-pipe', '-march=@arch@']

33
mingw-meson.sh Normal file
View File

@ -0,0 +1,33 @@
#!/bin/sh
# Usage: ./mingw-meson.sh prefix host
# host being i686 or x86_64
case $2 in
i686 | x86_64) ;;
*) echo "Usage: $0 prefix i686|x86_64" >&2; exit 1 ;;
esac
cpu=$2
host=$2-w64-mingw32
if test "x$2" = "xx86_64" ; then
arch=x86-64
else
arch=i686
fi
rm -rf builddir && mkdir builddir && cd builddir && cp ../meson-mingw-cross.txt .
sed -i -e "s/@cpu_family@/$cpu/g;s/@cpu@/$cpu/g;s/@host@/$host/g;s/@arch@/$arch/g" meson-mingw-cross.txt
meson .. \
--prefix=$1 \
--libdir=lib \
--buildtype=release \
--strip \
--cross-file meson-mingw-cross.txt \
--default-library shared \
-Dgraphite=enabled
ninja
ninja install