Files
MINGW-packages/mingw-w64-dlib/001-python-binding.patch
2019-08-08 23:10:20 +02:00

42 lines
1.5 KiB
Diff

--- a/dlib/external/pybind11/tools/FindPythonLibsNew.cmake
+++ b/dlib/external/pybind11/tools/FindPythonLibsNew.cmake
@@ -138,7 +138,7 @@
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")
--- a/setup.py
+++ b/setup.py
@@ -34,6 +34,7 @@
import sys
import shutil
import platform
+import sysconfig
import subprocess
import multiprocessing
from distutils import log
@@ -145,7 +146,7 @@
cfg = 'Debug' if self.debug else 'Release'
build_args = ['--config', cfg]
- if platform.system() == "Windows":
+ if platform.system() == "Windows" and sysconfig.get_platform() != 'mingw':
cmake_args += ['-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_{}={}'.format(cfg.upper(), extdir)]
if sys.maxsize > 2**32:
cmake_args += ['-A', 'x64']
@@ -188,8 +189,8 @@
# We are limited either by RAM or CPU cores. So pick the limiting amount
# and return that.
return max(min(num_cores, mem_cores), 1)
- except ValueError:
+ except:
- return 2 # just assume 2 if we can't get the os to tell us the right answer.
+ return 3 # just assume 3 if we can't get the os to tell us the right answer.
from setuptools.command.test import test as TestCommand