From f2d97c247f69983a78ca3b1d44849404b7ce8b98 Mon Sep 17 00:00:00 2001 From: Andrew Rogers Date: Mon, 23 Sep 2024 10:17:45 -0700 Subject: [PATCH] [gha] cross compile arm and aarch64 for Linux --- .github/workflows/build.yml | 57 +++++++++++++++++++++++++++++-------- 1 file changed, 45 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 78c9fcfd..aa4de7e4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -155,30 +155,63 @@ jobs: linux: runs-on: ubuntu-latest + name: Linux (${{ matrix.processor }}) + strategy: fail-fast: false matrix: include: - - { processor: x86_64, cflags: "", cxxflags: "" } - - { processor: i686, cflags: "-m32", cxxflags: "-m32" } + - processor: x86_64 + compiler_packages: + c_compiler: gcc + cxx_compiler: g++ + cflags: + cxxflags: + + - processor: i686 + compiler_packages: gcc-multilib g++-multilib + c_compiler: gcc + cxx_compiler: g++ + cflags: "-m32" + cxxflags: "-m32" + + - processor: arm + compiler_packages: gcc-arm-linux-gnueabi g++-arm-linux-gnueabi + c_compiler: arm-linux-gnueabi-gcc + cxx_compiler: arm-linux-gnueabi-g++ + cflags: + cxxflags: + + - processor: aarch64 + compiler_packages: gcc-aarch64-linux-gnu g++-aarch64-linux-gnu + c_compiler: aarch64-linux-gnu-gcc + cxx_compiler: aarch64-linux-gnu-g++ + cflags: + cxxflags: steps: - uses: actions/checkout@v4 + with: + path: ${{ github.workspace }}/SourceCache/ds2 + - run: | sudo apt-get update - sudo apt-get install -qq --no-install-recommends bison flex gcc-multilib g++-multilib ninja-build + sudo apt-get install -qq --no-install-recommends bison flex ninja-build ${{ matrix.compiler_packages }} - name: Configure run: | - cmake -B ${{ github.workspace }}/BinaryCache/ds2 \ - -C ${{ github.workspace }}/cmake/caches/GNUWarnings.cmake \ - -D CMAKE_BUILD_TYPE=Release \ - -D CMAKE_SYSTEM_NAME=Linux \ - -D CMAKE_SYSTEM_PROCESSOR=${{ matrix.processor }} \ - -D CMAKE_C_FLAGS=${{ matrix.cflags }} \ - -D CMAKE_CXX_FLAGS=${{ matrix.cxxflags }} \ - -G Ninja \ - -S ${{ github.workspace }} + cmake -B ${{ github.workspace }}/BinaryCache/ds2 \ + -S ${{ github.workspace }}/SourceCache/ds2 \ + -C ${{ github.workspace }}/SourceCache/ds2/cmake/caches/GNUWarnings.cmake \ + -D CMAKE_BUILD_TYPE=Release \ + -D CMAKE_SYSTEM_NAME=Linux \ + -D CMAKE_SYSTEM_PROCESSOR=${{ matrix.processor }} \ + -D CMAKE_C_COMPILER=${{ matrix.c_compiler }} \ + -D CMAKE_CXX_COMPILER=${{ matrix.cxx_compiler }} \ + -D CMAKE_C_FLAGS=${{ matrix.cflags }} \ + -D CMAKE_CXX_FLAGS=${{ matrix.cxxflags }} \ + -G Ninja + - name: Build run: cmake --build ${{ github.workspace }}/BinaryCache/ds2 --config Release