-
Notifications
You must be signed in to change notification settings - Fork 0
92 lines (75 loc) · 2.14 KB
/
cross-compiling.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: cross-compilation
on:
push:
pull_request:
release:
types: [published]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
ios:
name: ios
runs-on: macos-14
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: cmake-configure
run: |
cmake -S . -B build -GXcode --toolchain ios.toolchain.cmake
working-directory: ./chapter12/iOS_example/
shell: bash
- name: build
run: |
cmake --build ./build --config Release
shell: bash
working-directory: ./chapter12/iOS_example/
android:
name: android
runs-on: ubuntu-22.04
steps:
- uses: nttld/setup-ndk@v1
id: setup-ndk
with:
ndk-version: r23b
add-to-path: false
- uses: actions/checkout@v4
- name: cmake-configure
run: |
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release --toolchain=${ANDROID_NDK_HOME}/build/cmake/android.toolchain.cmake
working-directory: ./chapter12/android-example/
shell: bash
env:
ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
- name: build
run: |
cmake --build ./build --config Release
shell: bash
working-directory: ./chapter12/android-example/
arm:
name: arm-crosscompiling
runs-on: ubuntu-22.04
defaults:
run:
working-directory: ./chapter12/emulator-example/
steps:
- uses: actions/checkout@v4
- name: install dependencies
run: |
sudo apt -y update
sudo apt -y install qemu qemu-system-arm gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf libc6-dev-armhf-cross qemu-user ninja-build
- name: cmake-configure
run: |
cmake --preset ninja-arm64-build-debug
- name: cmake-build
run: |
cmake --build ./build
- name: run-emulator-test
run: |
cd build
ctest --verbose
- name: run-emulator-bare
run: |
cd build
qemu-arm -L /usr/arm-linux-gnueabihf ./ch12_emulator_example