-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Attempt to fix shared lib problem, mesonbuild/meson-python#700
- Loading branch information
1 parent
44de7a8
commit 3936518
Showing
3 changed files
with
19 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,21 @@ | ||
# pfapack Python package | ||
import os | ||
import sys | ||
from pathlib import Path | ||
|
||
from pfapack._version import __version__ | ||
|
||
|
||
def _enable_sharedlib_loading(): | ||
"""Enable loading of shared libraries from the package directory.""" | ||
if sys.platform == "win32": | ||
# Get the directory containing the shared libraries | ||
pkg_dir = Path(__file__).parent | ||
if hasattr(os, "add_dll_directory"): | ||
os.add_dll_directory(str(pkg_dir)) | ||
|
||
|
||
# Call this before loading the shared libraries | ||
_enable_sharedlib_loading() | ||
|
||
__all__ = ["__version__"] |