2929 fail-fast : false
3030 matrix :
3131 arch : [x86-64]
32+ family : [x86-64]
3233 compiler : [gcc, clang]
3334 container :
3435 - archlinux:latest
@@ -47,34 +48,39 @@ jobs:
4748 - ubuntu:jammy
4849 - ubuntu:focal
4950 - ubuntu:bionic
50- - ubuntu:xenial
51+ # Meson version on Ubuntu Xenial is really too old
52+ # - ubuntu:xenial
5153 cross_compile : [""]
5254 variant : [""]
5355 include :
5456 # Debian 32-bit builds
5557 - container : " debian:testing"
5658 arch : i386
57- compiler : gcc -m32
59+ family : x86
60+ compiler : gcc
5861 cross_compile : i686-linux-gnu
5962 pkg_config_path : /usr/lib/i386-linux-gnu/pkgconfig
6063 variant : i386
6164
6265 - container : " debian:stable"
6366 arch : i386
64- compiler : gcc -m32
67+ family : x86
68+ compiler : gcc
6569 cross_compile : i686-linux-gnu
6670 pkg_config_path : /usr/lib/i386-linux-gnu/pkgconfig
6771 variant : i386
6872
6973 - container : " debian:bookworm"
7074 arch : i386
71- compiler : gcc -m32
75+ family : x86
76+ compiler : gcc
7277 cross_compile : i686-linux-gnu
7378 pkg_config_path : /usr/lib/i386-linux-gnu/pkgconfig
7479 variant : i386
7580
7681 - container : " debian:buster"
7782 arch : i386
83+ family : x86
7884 compiler : gcc -m32
7985 cross_compile : i686-linux-gnu
8086 pkg_config_path : /usr/lib/i386-linux-gnu/pkgconfig
@@ -83,55 +89,63 @@ jobs:
8389 # Debian cross compilation builds
8490 - container : " debian:testing"
8591 arch : armhf
92+ family : arm
8693 compiler : arm-linux-gnueabihf-gcc
8794 cross_compile : arm-linux-gnueabihf
8895 pkg_config_path : /usr/lib/arm-linux-gnueabihf/pkgconfig
8996 variant : cross-compile
9097
9198 - container : " debian:testing"
9299 arch : arm64
100+ family : aarch64
93101 compiler : aarch64-linux-gnu-gcc
94102 cross_compile : aarch64-linux-gnu
95103 pkg_config_path : /usr/lib/aarch64-linux-gnu/pkgconfig
96104 variant : cross-compile
97105
98106 - container : " debian:testing"
99107 arch : ppc64el
108+ family : ppc64
100109 compiler : powerpc64le-linux-gnu-gcc
101110 cross_compile : powerpc64le-linux-gnu
102111 pkg_config_path : /usr/lib/powerpc64le-linux-gnu/pkgconfig
103112 variant : cross-compile
104113
105114 - container : " debian:testing"
106115 arch : s390x
116+ family : s390x
107117 compiler : s390x-linux-gnu-gcc
108118 cross_compile : s390x-linux-gnu
109119 pkg_config_path : /usr/lib/s390x-linux-gnu/pkgconfig
110120 variant : cross-compile
111121
112122 - container : " debian:stable"
113123 arch : armhf
124+ family : arm
114125 compiler : arm-linux-gnueabihf-gcc
115126 cross_compile : arm-linux-gnueabihf
116127 pkg_config_path : /usr/lib/arm-linux-gnueabihf/pkgconfig
117128 variant : cross-compile
118129
119130 - container : " debian:stable"
120131 arch : arm64
132+ family : aarch64
121133 compiler : aarch64-linux-gnu-gcc
122134 cross_compile : aarch64-linux-gnu
123135 pkg_config_path : /usr/lib/aarch64-linux-gnu/pkgconfig
124136 variant : cross-compile
125137
126138 - container : " debian:stable"
127139 arch : ppc64el
140+ family : ppc64
128141 compiler : powerpc64le-linux-gnu-gcc
129142 cross_compile : powerpc64le-linux-gnu
130143 pkg_config_path : /usr/lib/powerpc64le-linux-gnu/pkgconfig
131144 variant : cross-compile
132145
133146 - container : " debian:stable"
134147 arch : s390x
148+ family : s390x
135149 compiler : s390x-linux-gnu-gcc
136150 cross_compile : s390x-linux-gnu
137151 pkg_config_path : /usr/lib/s390x-linux-gnu/pkgconfig
@@ -141,9 +155,9 @@ jobs:
141155 image : ${{ matrix.container }}
142156 env :
143157 ARCH : ${{ matrix.arch }}
158+ FAMILY : ${{ matrix.family }}
144159 CC : ${{ matrix.compiler }}
145160 CROSS_COMPILE : ${{ matrix.cross_compile }}
146- MODE : ${{ matrix.mode }}
147161 PKG_CONFIG_PATH : ${{ matrix.pkg_config_path }}
148162 VARIANT : ${{ matrix.variant }}
149163
@@ -154,10 +168,11 @@ jobs:
154168 - name : Show env (matrix settings)
155169 run : |
156170 echo "ARCH: $ARCH"
171+ echo "FAMILY: $FAMILY"
157172 echo "CC: $CC"
158173 echo "CROSS_COMPILE: $CROSS_COMPILE"
159- echo "MODE: $MODE"
160174 echo "VARIANT: $VARIANT"
175+ echo "PKG_CONFIG_PATH: $PKG_CONFIG_PATH"
161176
162177 - name : Git checkout
163178 uses : actions/checkout@v3
@@ -187,8 +202,41 @@ jobs:
187202 echo "############################################"
188203 printenv
189204
205+ # i386 build on x86_64 only requires passing -m32 to CFLAGS & LDFLAGS
206+ - name : Meson init for i386
207+ if : ${{ matrix.variant == 'i386' }}
208+ run : |
209+ mkdir build
210+ CFLAGS="-m32" LDFLAGS="-m32" meson setup . build
211+
212+ - name : Meson init with cross compile
213+ if : ${{ matrix.variant == 'cross-compile' }}
214+ run : |
215+ # Generate cross compile file (see https://mesonbuild.com/Cross-compilation.html#cross-compilation)
216+ echo "[binaries]" > cross.txt
217+ echo "c = '${CROSS_COMPILE}-gcc'" >> cross.txt
218+ echo "strip = '${CROSS_COMPILE}-strip'" >> cross.txt
219+ # Forcing pkgconfig binary to 'pkg-config' is required for cross build to work
220+ echo "pkgconfig = 'pkg-config'" >> cross.txt
221+ echo "[host_machine]" >> cross.txt
222+ echo "system = 'linux'" >> cross.txt
223+ echo "cpu_family = '${FAMILY}'" >> cross.txt
224+ echo "cpu = '${ARCH}'" >> cross.txt
225+ echo "endian = 'little'" >> cross.txt
226+ echo "[properties]" >> cross.txt
227+ echo "pkg_config_libdir = '${PKG_CONFIG_PATH}'" >> cross.txt
228+ cat cross.txt
229+ mkdir build
230+ meson setup --cross-file cross.txt . build
231+
232+ - name : Meson init
233+ if : ${{ matrix.variant == '' }}
234+ run : |
235+ mkdir build
236+ meson setup . build
237+
190238 - name : Compile
191- run : make -j$(nproc)
239+ run : ninja -C build
192240
193241 - name : Install
194- run : make install
242+ run : ninja -C build install
0 commit comments