Add Windows non-abi3 cross compile test

This commit is contained in:
messense 2022-05-10 21:44:35 +08:00
parent c477718fe7
commit 5472fa6917
No known key found for this signature in database
GPG Key ID: BB41A8A2C716CCA9
2 changed files with 8 additions and 1 deletions

View File

@ -277,11 +277,17 @@ jobs:
env: env:
XWIN_ARCH: x86_64 XWIN_ARCH: x86_64
run: | run: |
set -ex
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
python -m pip install cargo-xwin python -m pip install cargo-xwin
# abi3
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 xwin 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
# non-abi3
export PYO3_CROSS_PYTHON_VERSION=3.9
cargo build --manifest-path examples/maturin-starter/Cargo.toml --features generate-import-lib --target x86_64-pc-windows-gnu
cargo xwin build --manifest-path examples/maturin-starter/Cargo.toml --features generate-import-lib --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

View File

@ -11,6 +11,7 @@ crate-type = ["cdylib"]
pyo3 = { path = "../../", features = ["extension-module"] } pyo3 = { path = "../../", features = ["extension-module"] }
[features] [features]
abi3 = ["pyo3/abi3-py37", "pyo3/generate-import-lib"] abi3 = ["pyo3/abi3-py37", "generate-import-lib"]
generate-import-lib = ["pyo3/generate-import-lib"]
[workspace] [workspace]