Skip to content

Commit

Permalink
github-actions: add cross-compiling
Browse files Browse the repository at this point in the history
  • Loading branch information
marckleinebudde committed May 29, 2024
1 parent 4cc79a4 commit c88ede8
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ jobs:
clang \
cmake \
gcc \
gcc-aarch64-linux-gnu \
gcc-arm-linux-gnueabihf \
make \
ninja-build
Expand All @@ -49,6 +51,34 @@ jobs:
podman exec -i stable cmake -DCMAKE_${BUILD}_TYPE=Debug -DCMAKE_C_COMPILER=${cc} -DENABLE_WERROR=ON -B build-${cc}
podman exec -i stable cmake --build build-${cc}
- name: Configure & Build with arm-linux-gnueabihf-gcc
env:
toolchain: arm-linux-gnueabihf-gcc
run: |
podman exec -i stable cmake -DCMAKE_${BUILD}_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=cmake/${toolchain}.cmake -DENABLE_WERROR=ON -B build-${toolchain}
podman exec -i stable cmake --build build-${toolchain}
- name: Configure & Build with arm-linux-gnueabihf-clang
env:
toolchain: arm-linux-gnueabihf-clang
run: |
podman exec -i stable cmake -DCMAKE_${BUILD}_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=cmake/${toolchain}.cmake -DENABLE_WERROR=ON -B build-${toolchain}
podman exec -i stable cmake --build build-${toolchain}
- name: Configure & Build with aarch64-linux-gnu-gcc
env:
toolchain: aarch64-linux-gnu-gcc
run: |
podman exec -i stable cmake -DCMAKE_${BUILD}_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=cmake/${toolchain}.cmake -DENABLE_WERROR=ON -B build-${toolchain}
podman exec -i stable cmake --build build-${toolchain}
- name: Configure & Build with aarch64-linux-gnu-clang
env:
toolchain: aarch64-linux-gnu-clang
run: |
podman exec -i stable cmake -DCMAKE_${BUILD}_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=cmake/${toolchain}.cmake -DENABLE_WERROR=ON -B build-${toolchain}
podman exec -i stable cmake --build build-${toolchain}
- name: Show logs
if: ${{ failure() }}
run: |
Expand Down
5 changes: 5 additions & 0 deletions cmake/aarch64-linux-gnu-gcc.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR aarch64)

set(CMAKE_C_COMPILER aarch64-linux-gnu-gcc)
set(CMAKE_C_COMPILER_TARGET aarch64-linux-gnu)
5 changes: 5 additions & 0 deletions cmake/arm-linux-gnueabihf-gcc.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR arm)

set(CMAKE_C_COMPILER arm-linux-gnueabihf-gcc)
set(CMAKE_C_COMPILER_TARGET arm-linux-gnueabihf)

0 comments on commit c88ede8

Please sign in to comment.