Use `cargo-xwin` to test windows msvc cross compilation

This commit is contained in:
messense 2022-04-11 00:19:20 +08:00
parent 4ba11f7615
commit 75ea171927
No known key found for this signature in database
GPG Key ID: BB41A8A2C716CCA9
1 changed files with 3 additions and 2 deletions

View File

@ -274,12 +274,13 @@ jobs:
- name: Test cross compile to Windows - name: Test cross compile to Windows
if: ${{ matrix.platform.os == 'ubuntu-latest' && matrix.python-version == '3.8' }} if: ${{ matrix.platform.os == 'ubuntu-latest' && matrix.python-version == '3.8' }}
env: env:
CARGO_TARGET_X86_64_PC_WINDOWS_MSVC_LINKER: rust-lld XWIN_ARCH: x86_64
run: | run: |
sudo apt-get install -y mingw-w64 llvm sudo apt-get install -y mingw-w64 llvm
rustup target add x86_64-pc-windows-gnu x86_64-pc-windows-msvc rustup target add x86_64-pc-windows-gnu x86_64-pc-windows-msvc
which cargo-xwin > /dev/null || cargo install cargo-xwin
cargo build --manifest-path examples/maturin-starter/Cargo.toml --features abi3 --target x86_64-pc-windows-gnu cargo build --manifest-path examples/maturin-starter/Cargo.toml --features abi3 --target x86_64-pc-windows-gnu
cargo build --manifest-path examples/maturin-starter/Cargo.toml --features abi3 --target x86_64-pc-windows-msvc cargo xwin build --manifest-path examples/maturin-starter/Cargo.toml --features abi3 --target x86_64-pc-windows-msvc
- name: Test cross compile to Windows with maturin - name: Test cross compile to Windows with maturin
if: ${{ matrix.platform.os == 'ubuntu-latest' && matrix.python-version == '3.8' }} if: ${{ matrix.platform.os == 'ubuntu-latest' && matrix.python-version == '3.8' }}
uses: messense/maturin-action@v1 uses: messense/maturin-action@v1