feat(ci): build libraries on windows x64 with mingw
This commit is contained in:
parent
e0edfe1cb3
commit
34ef1157a6
1 changed files with 56 additions and 0 deletions
56
.github/workflows/build.yml
vendored
56
.github/workflows/build.yml
vendored
|
|
@ -139,6 +139,62 @@ jobs:
|
|||
[[ -n $runner ]] && printf 'CROSS_RUNNER=%s\n' "$runner" >> $GITHUB_ENV
|
||||
fi
|
||||
|
||||
# TODO: Remove RUSTFLAGS="--cap-lints allow" once we use a wasmtime release that addresses
|
||||
# the `mismatched-lifetime-syntaxes` lint
|
||||
- name: Build wasmtime library (Windows x64 MSYS2)
|
||||
if: ${{ !matrix.use-cross && contains(matrix.features, 'wasm') && matrix.platform == 'windows-x64' }}
|
||||
run: |
|
||||
mkdir -p target
|
||||
WASMTIME_VERSION=$(cargo metadata --format-version=1 --locked --features wasm | \
|
||||
jq -r '.packages[] | select(.name == "wasmtime-c-api-impl") | .version')
|
||||
curl -LSs "$WASMTIME_REPO/archive/refs/tags/v${WASMTIME_VERSION}.tar.gz" | tar xzf - -C target
|
||||
cd target/wasmtime-${WASMTIME_VERSION}
|
||||
cmake -S crates/c-api -B target/c-api \
|
||||
-DCMAKE_INSTALL_PREFIX="$PWD/artifacts" \
|
||||
-DWASMTIME_DISABLE_ALL_FEATURES=ON \
|
||||
-DWASMTIME_FEATURE_CRANELIFT=ON \
|
||||
-DWASMTIME_TARGET='x86_64-pc-windows-gnu'
|
||||
cmake --build target/c-api && cmake --install target/c-api
|
||||
printf 'CMAKE_PREFIX_PATH=%s\n' "$PWD/artifacts" >> $GITHUB_ENV
|
||||
env:
|
||||
WASMTIME_REPO: https://github.com/bytecodealliance/wasmtime
|
||||
RUSTFLAGS: "--cap-lints allow"
|
||||
|
||||
- name: Install MinGW and Clang (Windows x64 MSYS2)
|
||||
if: ${{ matrix.platform == 'windows-x64' }}
|
||||
uses: msys2/setup-msys2@v2
|
||||
with:
|
||||
update: true
|
||||
install: |
|
||||
mingw-w64-x86_64-toolchain
|
||||
mingw-w64-x86_64-clang
|
||||
mingw-w64-x86_64-make
|
||||
mingw-w64-x86_64-cmake
|
||||
|
||||
- name: Build C library (Windows x64 MSYS2 CMake)
|
||||
if: ${{ matrix.platform == 'windows-x64' }}
|
||||
shell: msys2 {0}
|
||||
run: |
|
||||
cmake -G Ninja -S lib -B build/static \
|
||||
-DBUILD_SHARED_LIBS=OFF \
|
||||
-DCMAKE_BUILD_TYPE=Debug \
|
||||
-DCMAKE_COMPILE_WARNING_AS_ERROR=ON \
|
||||
-DTREE_SITTER_FEATURE_WASM=$WASM \
|
||||
-DCMAKE_C_COMPILER=clang
|
||||
cmake --build build/static
|
||||
rm -rf build/static
|
||||
|
||||
cmake -G Ninja -S lib -B build/shared \
|
||||
-DBUILD_SHARED_LIBS=ON \
|
||||
-DCMAKE_BUILD_TYPE=Debug \
|
||||
-DCMAKE_COMPILE_WARNING_AS_ERROR=ON \
|
||||
-DTREE_SITTER_FEATURE_WASM=$WASM \
|
||||
-DCMAKE_C_COMPILER=clang
|
||||
cmake --build build/shared
|
||||
rm -rf build/shared
|
||||
env:
|
||||
WASM: ${{ contains(matrix.features, 'wasm') && 'ON' || 'OFF' }}
|
||||
|
||||
# TODO: Remove RUSTFLAGS="--cap-lints allow" once we use a wasmtime release that addresses
|
||||
# the `mismatched-lifetime-syntaxes` lint
|
||||
- name: Build wasmtime library
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue