25 lines
714 B
Diff
25 lines
714 B
Diff
--- a/rtree/finder.py
|
|
+++ b/rtree/finder.py
|
|
@@ -8,6 +8,7 @@
|
|
import os
|
|
import platform
|
|
import sys
|
|
+import sysconfig
|
|
from ctypes.util import find_library
|
|
|
|
# the current working directory of this file
|
|
@@ -29,6 +29,13 @@
|
|
:returns: Loaded shared library
|
|
"""
|
|
if os.name == "nt":
|
|
+ if sysconfig.get_platform().startswith("mingw"):
|
|
+ lib_name = 'libspatialindex_c'
|
|
+ path = find_library(lib_name)
|
|
+ if path is None:
|
|
+ raise OSError("could not find or load {}".format(lib_name))
|
|
+ return ctypes.cdll.LoadLibrary(path)
|
|
+
|
|
# check the platform architecture
|
|
if "64" in platform.architecture()[0]:
|
|
arch = "64"
|