Commit 1259db6f by Jerome Robert Committed by GitHub

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
parent c2db53da
...@@ -47,6 +47,7 @@ import tempfile ...@@ -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 ...@@ -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++{}"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment