Skip to content

Commit 070a7a4

Browse files
committed
🏁 patch dll directory on Windows
Signed-off-by: burgholzer <burgholzer@me.com>
1 parent b3c501d commit 070a7a4

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/mqt/qcec/__init__.py

+17
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,23 @@
66

77
from __future__ import annotations
88

9+
import sys
10+
11+
# under Windows, make sure to add the appropriate DLL directory to the PATH
12+
if sys.platform == "win32":
13+
14+
def _dll_patch() -> None:
15+
"""Add the DLL directory to the PATH."""
16+
import os
17+
import sysconfig
18+
from pathlib import Path
19+
20+
bin_dir = Path(sysconfig.get_paths()["purelib"]) / "mqt" / "core" / "bin"
21+
os.add_dll_directory(str(bin_dir))
22+
23+
_dll_patch()
24+
del _dll_patch
25+
926
from ._version import version as __version__
1027
from .compilation_flow_profiles import AncillaMode
1128
from .pyqcec import (

0 commit comments

Comments
 (0)