mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-21 20:55:11 +00:00
da91926295
* Inject -stdlib=libc++ on macOS only when it's supported, close #4637. On macOS, by default, pybind11 currently unconditionally set the compiler flag "-stdlib=libc++" in Pybind11Extension.__init__(), regardless of which compiler is used. This flag is required for clang, but is invalid for GCC. If GCC is used, it causes compilation failures in all Python projects that use pybind11, with the error message: arm64-apple-darwin22-gcc: error: unrecognized command-line option -stdlib=libc++. This commit uses has_flag() to detect whether "-stdlib=libc++" on macOS, and injects this flag from build_ext.build_extensions(), rather than setting it unconditionally. Signed-off-by: Yifeng Li <tomli@tomli.me> * revert: just remove flags --------- Signed-off-by: Yifeng Li <tomli@tomli.me> Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com> |
||
---|---|---|
.. | ||
__init__.py | ||
__main__.py | ||
_version.py | ||
commands.py | ||
py.typed | ||
setup_helpers.py |