Build Binaryen #28
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 (cross-compile) | |
- os: ubuntu-latest | |
arch: x64 | |
target: windows | |
cmake-args: > | |
-DCMAKE_SYSTEM_NAME=Windows | |
-DCMAKE_C_COMPILER=x86_64-w64-mingw32-gcc | |
-DCMAKE_CXX_COMPILER=x86_64-w64-mingw32-g++ | |
-DBUILD_SHARED_LIBS=ON | |
-DBUILD_TOOLS=OFF | |
-DBUILD_TESTS=OFF | |
-DBINARYEN_CORES=1 | |
runtime: win-x64 | |
# Windows 32-bit (cross-compile) | |
- os: ubuntu-latest | |
arch: x86 | |
target: windows | |
cmake-args: > | |
-DCMAKE_SYSTEM_NAME=Windows | |
-DCMAKE_C_COMPILER=i686-w64-mingw32-gcc | |
-DCMAKE_CXX_COMPILER=i686-w64-mingw32-g++ | |
-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 | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y g++-multilib gcc-multilib cmake make mingw-w64 | |
- name: Configure | |
run: cmake -S binaryen -B binaryen ${{ matrix.cmake-args }} | |
- name: Build | |
run: cmake --build binaryen -- -j$(nproc) | |
- name: Copy to NuGet runtime folder | |
run: | | |
mkdir -p package/runtimes/${{ matrix.runtime }}/native | |
cp -r binaryen/build/lib/* package/runtimes/${{ matrix.runtime }}/native/ | |
shell: bash | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: runtimes-${{ matrix.runtime }} | |
path: package/runtimes/${{ matrix.runtime }} |