File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -210,6 +210,21 @@ jobs:
210210 echo
211211 done
212212
213+ - name : Copy DLL to package directory (Windows)
214+ if : runner.os == 'Windows'
215+ shell : bash
216+ run : |
217+ # Copy the DLL to the package directory so maturin can include it in the wheel
218+ # The maturin.include in pyproject.toml expects it relative to the package root
219+ if [ -f "$TKET_C_API_PATH/bin/tket-c-api.dll" ]; then
220+ cp "$TKET_C_API_PATH/bin/tket-c-api.dll" "$MODULE_DIR/tket-c-api.dll"
221+ echo "Copied DLL to $MODULE_DIR/tket-c-api.dll"
222+ ls -lh "$MODULE_DIR/tket-c-api.dll"
223+ else
224+ echo "ERROR: DLL not found at $TKET_C_API_PATH/bin/tket-c-api.dll"
225+ exit 1
226+ fi
227+
213228 - name : Build wheels
214229 shell : bash
215230 run : |
Original file line number Diff line number Diff line change @@ -61,6 +61,13 @@ module-name = "tket._tket"
6161manifest-path = " Cargo.toml"
6262# "extension-module" tells pyo3 we want to build an extension module (skips linking against libpython.so)
6363features = [" pyo3/extension-module" ]
64+ include = [
65+ # In windows targets, we need to explicitly include the DLL file if we want
66+ # the wheel to be portable.
67+ #
68+ # This gets ignored when building for non-windows targets.
69+ " tket-c-api.dll" ,
70+ ]
6471
6572[tool .pytest .ini_options ]
6673# Lark throws deprecation warnings for `src_parse` and `src_constants`.
You can’t perform that action at this time.
0 commit comments