45 lines
1.9 KiB
Diff
Executable File
45 lines
1.9 KiB
Diff
Executable File
diff --git a/cmake/FindPythonLibsNew.cmake b/cmake/FindPythonLibsNew.cmake
|
|
index 919a384..931d49e 100644
|
|
--- a/cmake/FindPythonLibsNew.cmake
|
|
+++ b/cmake/FindPythonLibsNew.cmake
|
|
@@ -141,7 +141,7 @@ string(REGEX REPLACE "\\\\" "/" PYTHON_PREFIX ${PYTHON_PREFIX})
|
|
string(REGEX REPLACE "\\\\" "/" PYTHON_INCLUDE_DIR ${PYTHON_INCLUDE_DIR})
|
|
string(REGEX REPLACE "\\\\" "/" PYTHON_SITE_PACKAGES ${PYTHON_SITE_PACKAGES})
|
|
|
|
-if(CMAKE_HOST_WIN32)
|
|
+if(CMAKE_HOST_WIN32 AND NOT (MSYS OR MINGW))
|
|
set(PYTHON_LIBRARY
|
|
"${PYTHON_PREFIX}/libs/Python${PYTHON_LIBRARY_SUFFIX}.lib")
|
|
|
|
diff --git a/setup.py b/setup.py
|
|
index 79e91b6..1f32d2f 100644
|
|
--- a/setup.py
|
|
+++ b/setup.py
|
|
@@ -201,7 +201,7 @@ class BuildLibrary(build_ext):
|
|
]
|
|
|
|
|
|
- if platform.system() == "Windows":
|
|
+ if platform.system() == "Windows" and not sysconfig.get_platform().startswith("mingw"):
|
|
from setuptools import msvc
|
|
|
|
cmake_args += [
|
|
@@ -241,7 +241,7 @@ class BuildLibrary(build_ext):
|
|
if self.distribution.doc:
|
|
targets['doc'] = "lief-doc"
|
|
|
|
- if platform.system() == "Windows":
|
|
+ if platform.system() == "Windows" and not sysconfig.get_platform().startswith("mingw"):
|
|
build_cmd = ['cmake', '--build', '.', '--target', "lief_samples"] + build_args
|
|
#log.info(" ".join(build_cmd))
|
|
|
|
@@ -299,7 +299,7 @@ class BuildLibrary(build_ext):
|
|
libsuffix = pylief_dst.split(".")[-1]
|
|
|
|
pylief_path = os.path.join(cmake_library_output_directory, "{}.{}".format(PACKAGE_NAME, libsuffix))
|
|
- if platform.system() == "Windows":
|
|
+ if platform.system() == "Windows" and not sysconfig.get_platform().startswith("mingw"):
|
|
pylief_base = pathlib.Path(cmake_library_output_directory) / "Release" / "api" / "python"
|
|
pylief_path = pylief_base / "Release" / "{}.{}".format(PACKAGE_NAME, libsuffix)
|
|
if not pylief_path.is_file():
|