Skip to content

Commit

Permalink
Add Windows non-abi3 cross compile test
Browse files Browse the repository at this point in the history
  • Loading branch information
messense committed May 10, 2022
1 parent 4305b31 commit 0f30a02
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .github/workflows/ci.yml
Expand Up @@ -280,8 +280,13 @@ jobs:
sudo apt-get install -y mingw-w64 llvm
rustup target add x86_64-pc-windows-gnu x86_64-pc-windows-msvc
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 xwin build --manifest-path examples/maturin-starter/Cargo.toml --features abi3 --target x86_64-pc-windows-msvc
# non-abi3
export PYO3_CONFIG_FILE=$(pwd)/examples/maturin-starter/pyo3-config-windows-3.9.txt
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
if: ${{ matrix.platform.os == 'ubuntu-latest' && matrix.python-version == '3.8' }}
uses: messense/maturin-action@v1
Expand Down
3 changes: 2 additions & 1 deletion examples/maturin-starter/Cargo.toml
Expand Up @@ -11,6 +11,7 @@ crate-type = ["cdylib"]
pyo3 = { path = "../../", features = ["extension-module"] }

[features]
abi3 = ["pyo3/abi3-py37", "pyo3/generate-import-lib"]
abi3 = ["pyo3/abi3-py37", "generate-import-lib"]
generate-import-lib = ["pyo3/generate-import-lib"]

[workspace]
6 changes: 6 additions & 0 deletions examples/maturin-starter/pyo3-config-windows-3.9.txt
@@ -0,0 +1,6 @@
implementation=CPython
version=3.9
shared=true
abi3=false
pointer_width=64
suppress_build_script_link_lines=false

0 comments on commit 0f30a02

Please sign in to comment.