-
Notifications
You must be signed in to change notification settings - Fork 8
83 lines (67 loc) · 2.04 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
name: cross-compilation
on:
push:
pull_request:
release:
types: [published]
jobs:
ios:
name: ios
runs-on: macos-14
steps:
- uses: actions/checkout@v1
- 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@v1
- 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.0
steps:
- uses: actions/checkout@v1
- 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
- name: cmake-configure
run: |
cmake -S ./chapter12/emulator-example -B build --toolchain=$(pwd)/chapter12/emulator-example/arm64.toolchain.cmake
- name: cmake-build
run: |
cmake --build ./build
- name: run-emulator-test
run: |
ctest --verbose
working-directory: ./build
- name: run-emulator-bare
run: |
qemu-arm -L /usr/arm-linux-gnueabihf ./ch12_emulator_example
working-directory: ./build