Skip to content

feat: add include-import-lib option to bundle Windows import libraries in wheels#3017

Open
messense wants to merge 1 commit intoPyO3:mainfrom
messense:include-import-lib
Open

feat: add include-import-lib option to bundle Windows import libraries in wheels#3017
messense wants to merge 1 commit intoPyO3:mainfrom
messense:include-import-lib

Conversation

@messense
Copy link
Member

Add a new include-import-lib option (defaults to false) in [tool.maturin] that includes the Windows import library (.dll.lib for MSVC, .dll.a for MinGW) in the built wheel. This enables users who distribute shared libraries via wheels to allow other programs to link against them at compile time.

The import library path is extracted directly from cargo's JSON build output (the extra filenames reported alongside the primary artifact), so no extra file copying to staging directories is needed.

Supported for all binding types that produce cdylibs/dlls: cffi, uniffi, and pyo3.

Closes #2289

…s in wheels

Add a new `include-import-lib` option (defaults to false) in `[tool.maturin]`
that includes the Windows import library (.dll.lib for MSVC, .dll.a for MinGW)
in the built wheel. This enables users who distribute shared libraries via
wheels to allow other programs to link against them at compile time.

The import library path is extracted directly from cargo's JSON build output
(the extra filenames reported alongside the primary artifact), so no extra
file copying to staging directories is needed.

Supported for all binding types that produce cdylibs/dlls: cffi, uniffi, and pyo3.

Closes PyO3#2289
@messense messense changed the title feat: add include-import-lib option to bundle Windows import libraries in wheels feat: add include-import-lib option to bundle Windows import libraries in wheels Feb 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add the *.lib file to the wheel built by maturin on Windows (with the cffi bindings)

1 participant

Comments