Skip to content

Commit bc2f990

Browse files
authored
[gha] cross compile arm and aarch64 for Linux (#133)
Add arm and aarch64 cross-compilation to the existing linux build job
1 parent 51cc9af commit bc2f990

File tree

1 file changed

+45
-12
lines changed

1 file changed

+45
-12
lines changed

.github/workflows/build.yml

Lines changed: 45 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -155,30 +155,63 @@ jobs:
155155
linux:
156156
runs-on: ubuntu-latest
157157

158+
name: Linux (${{ matrix.processor }})
159+
158160
strategy:
159161
fail-fast: false
160162
matrix:
161163
include:
162-
- { processor: x86_64, cflags: "", cxxflags: "" }
163-
- { processor: i686, cflags: "-m32", cxxflags: "-m32" }
164+
- processor: x86_64
165+
compiler_packages:
166+
c_compiler: gcc
167+
cxx_compiler: g++
168+
cflags:
169+
cxxflags:
170+
171+
- processor: i686
172+
compiler_packages: gcc-multilib g++-multilib
173+
c_compiler: gcc
174+
cxx_compiler: g++
175+
cflags: "-m32"
176+
cxxflags: "-m32"
177+
178+
- processor: arm
179+
compiler_packages: gcc-arm-linux-gnueabi g++-arm-linux-gnueabi
180+
c_compiler: arm-linux-gnueabi-gcc
181+
cxx_compiler: arm-linux-gnueabi-g++
182+
cflags:
183+
cxxflags:
184+
185+
- processor: aarch64
186+
compiler_packages: gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
187+
c_compiler: aarch64-linux-gnu-gcc
188+
cxx_compiler: aarch64-linux-gnu-g++
189+
cflags:
190+
cxxflags:
164191

165192
steps:
166193
- uses: actions/checkout@v4
194+
with:
195+
path: ${{ github.workspace }}/SourceCache/ds2
196+
167197
- run: |
168198
sudo apt-get update
169-
sudo apt-get install -qq --no-install-recommends bison flex gcc-multilib g++-multilib ninja-build
199+
sudo apt-get install -qq --no-install-recommends bison flex ninja-build ${{ matrix.compiler_packages }}
170200
171201
- name: Configure
172202
run: |
173-
cmake -B ${{ github.workspace }}/BinaryCache/ds2 \
174-
-C ${{ github.workspace }}/cmake/caches/GNUWarnings.cmake \
175-
-D CMAKE_BUILD_TYPE=Release \
176-
-D CMAKE_SYSTEM_NAME=Linux \
177-
-D CMAKE_SYSTEM_PROCESSOR=${{ matrix.processor }} \
178-
-D CMAKE_C_FLAGS=${{ matrix.cflags }} \
179-
-D CMAKE_CXX_FLAGS=${{ matrix.cxxflags }} \
180-
-G Ninja \
181-
-S ${{ github.workspace }}
203+
cmake -B ${{ github.workspace }}/BinaryCache/ds2 \
204+
-S ${{ github.workspace }}/SourceCache/ds2 \
205+
-C ${{ github.workspace }}/SourceCache/ds2/cmake/caches/GNUWarnings.cmake \
206+
-D CMAKE_BUILD_TYPE=Release \
207+
-D CMAKE_SYSTEM_NAME=Linux \
208+
-D CMAKE_SYSTEM_PROCESSOR=${{ matrix.processor }} \
209+
-D CMAKE_C_COMPILER=${{ matrix.c_compiler }} \
210+
-D CMAKE_CXX_COMPILER=${{ matrix.cxx_compiler }} \
211+
-D CMAKE_C_FLAGS=${{ matrix.cflags }} \
212+
-D CMAKE_CXX_FLAGS=${{ matrix.cxxflags }} \
213+
-G Ninja
214+
182215
- name: Build
183216
run: cmake --build ${{ github.workspace }}/BinaryCache/ds2 --config Release
184217

0 commit comments

Comments
 (0)