Build Binaryen #21
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: | |
| - os: windows-latest | |
| arch: x64 | |
| runtime: win-x64 | |
| - os: windows-latest | |
| arch: x86 | |
| runtime: win-x86 | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Install MinGW and CMake | |
| if: runner.os == 'Windows' | |
| run: | | |
| choco install mingw --no-progress --yes | |
| choco install cmake ninja --no-progress --yes | |
| shell: pwsh | |
| - name: Add MinGW to PATH | |
| if: runner.os == 'Windows' | |
| run: | | |
| if (${{ matrix.arch }} -eq 'x64') { | |
| $mingw = "C:\tools\mingw64\bin" | |
| } else { | |
| $mingw = "C:\tools\mingw32\bin" | |
| } | |
| $env:PATH = "$mingw;$env:PATH" | |
| echo "PATH=$env:PATH" >> $GITHUB_ENV | |
| shell: pwsh | |
| - name: Limit Binaryen to 1 core | |
| run: echo "BINARYEN_CORES=1" >> $GITHUB_ENV | |
| - name: Configure | |
| run: | | |
| if (${{ runner.os }} -eq 'Windows') { | |
| if (${{ matrix.arch }} -eq 'x64') { | |
| cmake -S binaryen -B binaryen/build -G "MinGW Makefiles" -DCMAKE_C_FLAGS="-W0 -m64 -static-libgcc -static-libstdc++" -DCMAKE_CXX_FLAGS="-W0 -m64 -static-libgcc -static-libstdc++" -DBUILD_STATIC_LIB=OFF -DBUILD_SHARED_LIBS=ON -DBUILD_TOOLS=OFF -DBUILD_TESTS=OFF | |
| } else { | |
| cmake -S binaryen -B binaryen/build -G "MinGW Makefiles" -DCMAKE_C_FLAGS="-W0 -m32 -static-libgcc -static-libstdc++" -DCMAKE_CXX_FLAGS="-W0 -m32 -static-libgcc -static-libstdc++" -DBUILD_STATIC_LIB=OFF -DBUILD_SHARED_LIBS=ON -DBUILD_TOOLS=OFF -DBUILD_TESTS=OFF | |
| } | |
| } | |
| shell: pwsh | |
| - name: Build (Windows) | |
| if: runner.os == 'Windows' | |
| run: cmake --build binaryen/build -- -j1 | |
| shell: pwsh |