mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-28 08:02:00 +00:00
Fix Pybind11Extension on mingw64 (#2921)
* Pybind11Extension add the "/EHsc /bigobj /std:c++14" flags on Windows. This is good for Visual C++ but not for Mingw. * According https://github.com/msys2/MINGW-packages/blob/master/mingw-w64-python2/0410-MINGW-build-extensions-with-GCC.patch sysconfig.get_platform() is the way to check for a Mingw64
This commit is contained in:
parent
c2db53da56
commit
1259db6fd9
@ -47,6 +47,7 @@ import tempfile
|
|||||||
import threading
|
import threading
|
||||||
import platform
|
import platform
|
||||||
import warnings
|
import warnings
|
||||||
|
import sysconfig
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from setuptools.command.build_ext import build_ext as _build_ext
|
from setuptools.command.build_ext import build_ext as _build_ext
|
||||||
@ -59,7 +60,7 @@ import distutils.errors
|
|||||||
import distutils.ccompiler
|
import distutils.ccompiler
|
||||||
|
|
||||||
|
|
||||||
WIN = sys.platform.startswith("win32")
|
WIN = sys.platform.startswith("win32") and sysconfig.get_platform() != "mingw"
|
||||||
PY2 = sys.version_info[0] < 3
|
PY2 = sys.version_info[0] < 3
|
||||||
MACOS = sys.platform.startswith("darwin")
|
MACOS = sys.platform.startswith("darwin")
|
||||||
STD_TMPL = "/std:c++{}" if WIN else "-std=c++{}"
|
STD_TMPL = "/std:c++{}" if WIN else "-std=c++{}"
|
||||||
|
Loading…
Reference in New Issue
Block a user