@@ -12,53 +12,44 @@ jobs:
12
12
include :
13
13
- os : macOS-latest
14
14
target : aarch64-apple-darwin
15
+ cmake-options : -DCMAKE_OSX_ARCHITECTURES=arm64
15
16
path : macos/arm64
16
- shared-ext : dylib
17
- static-ext : a
18
17
- os : macOS-latest
19
18
target : x86_64-apple-darwin
20
19
path : macos/x86_64
21
- shared-ext : dylib
22
- static-ext : a
23
20
- os : windows-2019
24
21
target : aarch64-pc-windows-msvc
22
+ setup-step : ' cmd.exe /k "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsamd64_x86.bat" `& powershell'
23
+ cmake-options : -A ARM64
25
24
path : windows/arm64/msvc
26
- shared-ext : dll
27
- static-ext : lib
28
25
- os : windows-2019
29
26
target : i686-pc-windows-msvc
27
+ setup-step : ' cmd.exe /k "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars32.bat" `& powershell'
28
+ cmake-options : -A Win32
30
29
path : windows/x86/msvc
31
- shared-ext : dll
32
- static-ext : lib
33
30
- os : windows-2019
34
31
target : x86_64-pc-windows-msvc
32
+ setup-step : ' cmd.exe /k "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat" `& powershell'
35
33
path : windows/x86_64/msvc
36
- shared-ext : dll
37
- static-ext : lib
38
34
- os : ubuntu-latest
39
35
target : i686-pc-windows-gnu
40
- use-cross : true
36
+ setup-step : sudo apt update && sudo apt install -y mingw-w64
37
+ cmake-options : -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_SYSTEM_PROCESSOR=x86 -DCMAKE_C_COMPILER=i686-w64-mingw32-gcc -DCMAKE_CXX_COMPILER=i686-w64-mingw32-g++
41
38
path : windows/x86/mingw
42
- shared-ext : dll
43
- static-ext : a
44
39
- os : ubuntu-latest
45
40
target : x86_64-pc-windows-gnu
46
- use-cross : true
41
+ setup-step : sudo apt update && sudo apt install -y mingw-w64
42
+ cmake-options : -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_SYSTEM_PROCESSOR=x86_64 -DCMAKE_C_COMPILER=x86_64-w64-mingw32-gcc -DCMAKE_CXX_COMPILER=x86_64-w64-mingw32-g++
47
43
path : windows/x86_64/mingw
48
- shared-ext : dll
49
- static-ext : a
50
44
- os : ubuntu-latest
51
45
target : i686-unknown-linux-gnu
52
- use-cross : true
46
+ setup-step : sudo apt update && sudo apt install -y gcc-multilib g++-multilib
47
+ cmake-options : -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_SYSTEM_PROCESSOR=x86
53
48
path : linux/x86
54
- shared-ext : so
55
- static-ext : a
56
49
- os : ubuntu-latest
57
50
target : x86_64-unknown-linux-gnu
58
51
path : linux/x86_64
59
- shared-ext : so
60
- static-ext : a
61
- name : cargo build
52
+ name : Build
62
53
steps :
63
54
- uses : actions/checkout@v3
64
55
@@ -70,34 +61,18 @@ jobs:
70
61
profile : minimal
71
62
override : true
72
63
73
- - name : cargo build
74
- uses : actions-rs/cargo@v1
75
- with :
76
- command : build
77
- use-cross : ${{ matrix.use-cross || false }}
78
- args : --package accesskit_c --release --target ${{ matrix.target }}
79
-
80
- - shell : bash
81
- run : |
82
- mkdir -p artifacts/${{ matrix.path }}/shared
83
- mkdir -p artifacts/${{ matrix.path }}/static
84
-
85
- - if : startsWith(matrix.os, 'windows')
64
+ - name : build libraries
86
65
run : |
87
- mv target/${{ matrix.target }}/release/accesskit.dll.lib artifacts/${{ matrix.path }}/shared/accesskit.lib
88
- mv target/${{ matrix.target }}/release/*.pdb artifacts/${{ matrix.path }}/shared
89
- - if : contains(matrix.path, 'mingw')
90
- run : mv target/${{ matrix.target }}/release/libaccesskit.dll.a artifacts/${{ matrix.path }}/shared/libaccesskit.a
91
-
92
- - run : |
93
- mv target/${{ matrix.target }}/release/*.${{ matrix.shared-ext }} artifacts/${{ matrix.path }}/shared
94
- mv target/${{ matrix.target }}/release/*.${{ matrix.static-ext }} artifacts/${{ matrix.path }}/static
66
+ ${{ matrix.setup-step || '' }}
67
+ cmake -S bindings/c -B build -DACCESSKIT_BUILD_HEADERS=OFF -DRust_CARGO_TARGET=${{ matrix.target }} ${{ matrix.cmake-options || '' }} ${{ !contains(matrix.target, 'msvc') && '-DCMAKE_BUILD_TYPE=Release' || '' }}
68
+ cmake --build build ${{ contains(matrix.target, 'msvc') && '--config Release' || '' }}
69
+ cmake --install build ${{ contains(matrix.target, 'msvc') && '--config Release' || '' }}
95
70
96
71
- name : Upload binaries
97
72
uses : actions/upload-artifact@v3
98
73
with :
99
74
name : ${{ matrix.target }}
100
- path : artifacts
75
+ path : bindings/c/lib
101
76
102
77
generate-headers :
103
78
if : startsWith(github.ref_name, 'accesskit_c-v')
0 commit comments