Skip to content

Commit

Permalink
Fix Pybind11Extension on mingw64 (#2921)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
jeromerobert authored Apr 2, 2021
1 parent c2db53d commit 1259db6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pybind11/setup_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
import threading
import platform
import warnings
import sysconfig

try:
from setuptools.command.build_ext import build_ext as _build_ext
Expand All @@ -59,7 +60,7 @@
import distutils.ccompiler


WIN = sys.platform.startswith("win32")
WIN = sys.platform.startswith("win32") and sysconfig.get_platform() != "mingw"
PY2 = sys.version_info[0] < 3
MACOS = sys.platform.startswith("darwin")
STD_TMPL = "/std:c++{}" if WIN else "-std=c++{}"
Expand Down

0 comments on commit 1259db6

Please sign in to comment.