-
Notifications
You must be signed in to change notification settings - Fork 0
116 lines (104 loc) · 3.67 KB
/
buildbinaryen.yml
File metadata and controls
116 lines (104 loc) · 3.67 KB
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
name: Build Binaryen
on:
workflow_dispatch:
jobs:
build:
strategy:
matrix:
include:
# Linux 64-bit
- os: ubuntu-latest
arch: x64
target: linux
cmake-args: >
-DCMAKE_C_FLAGS="-m64 -w -static-libgcc -static-libstdc++"
-DCMAKE_CXX_FLAGS="-m64 -w -static-libgcc -static-libstdc++"
-DBUILD_SHARED_LIBS=ON
-DBUILD_TOOLS=OFF
-DBUILD_TESTS=OFF
-DBINARYEN_CORES=1
runtime: linux-x64
# Linux 32-bit
- os: ubuntu-latest
arch: x86
target: linux
cmake-args: >
-DCMAKE_C_FLAGS="-m32 -w -static-libgcc -static-libstdc++"
-DCMAKE_CXX_FLAGS="-m32 -w -static-libgcc -static-libstdc++"
-DBUILD_SHARED_LIBS=ON
-DBUILD_TOOLS=OFF
-DBUILD_TESTS=OFF
-DBINARYEN_CORES=1
runtime: linux-x86
# Windows 64-bit
- os: windows-latest
arch: x64
target: windows
cmake-args: >
-G "MinGW Makefiles"
-DCMAKE_C_COMPILER=gcc.exe
-DCMAKE_CXX_COMPILER=g++.exe
-DCMAKE_C_FLAGS="-m64 -w -static-libgcc -static-libstdc++"
-DCMAKE_CXX_FLAGS="-m64 -w -static-libgcc -static-libstdc++"
-DBUILD_SHARED_LIBS=ON
-DBUILD_TOOLS=OFF
-DBUILD_TESTS=OFF
-DBINARYEN_CORES=1
runtime: win-x64
# Windows 32-bit
- os: windows-latest
arch: x86
target: windows
cmake-args: >
-G "MinGW Makefiles"
-DCMAKE_C_COMPILER=gcc.exe
-DCMAKE_CXX_COMPILER=g++.exe
-DCMAKE_C_FLAGS="-m32 -w -static-libgcc -static-libstdc++"
-DCMAKE_CXX_FLAGS="-m32 -w -static-libgcc -static-libstdc++"
-DBUILD_SHARED_LIBS=ON
-DBUILD_TOOLS=OFF
-DBUILD_TESTS=OFF
-DBINARYEN_CORES=1
runtime: win-x86
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install build dependencies (Linux)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y g++-multilib gcc-multilib cmake make
- name: Install build dependencies (Windows)
if: matrix.os == 'windows-latest'
run: |
choco install mingw --version 13.2.0 -y --force
- name: Add MinGW to PATH (Windows)
if: matrix.os == 'windows-latest'
run: |
echo "C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\bin" >> $env:GITHUB_PATH
shell: pwsh
- name: Configure
run: cmake -S binaryen -B binaryen ${{ matrix.cmake-args }}
- name: Build (Linux)
if: matrix.os == 'ubuntu-latest'
run: cmake --build binaryen -- -j$(nproc)
- name: Build (Windows)
if: matrix.os == 'windows-latest'
run: cmake --build binaryen
shell: bash
- name: Copy to NuGet runtime folder
run: |
mkdir -p package/runtimes/${{ matrix.runtime }}/native
if [[ "${{ matrix.target }}" == "windows" ]]; then
cp -r binaryen/bin/* package/runtimes/${{ matrix.runtime }}/native/
else
cp -r binaryen/lib/* package/runtimes/${{ matrix.runtime }}/native/
fi
shell: bash
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: runtimes-${{ matrix.runtime }}
path: package/runtimes/${{ matrix.runtime }}