Make determination of PYBIND11_COMPILER_TYPE "macos" or "glibc" more general.

The main motivation is to resolve these "Manylinux on 🐍 3.13t • GIL" and "Pyodide wheel" failures:

```
/__w/pybind11/pybind11/include/pybind11/conduit/pybind11_platform_abi_id.h:35:10: error: #error "Unknown PYBIND11_COMPILER_TYPE: PLEASE REVISE THIS CODE."
   35 | #        error "Unknown PYBIND11_COMPILER_TYPE: PLEASE REVISE THIS CODE."
      |          ^~~~~
```

(All other CI jobs succeeded.)

Further thought:

Essentially, under Linux and macOS the `PYBIND11_COMPILER_TYPE` is only for informational purposes.
ABI compatibility is determined by the libstdc++ or libc++ ABI version.
This commit is contained in:
Ralf W. Grosse-Kunstleve 2024-12-03 11:40:28 -08:00
parent ca9e6990de
commit 41daaa41fa
No known key found for this signature in database

View File

@ -23,14 +23,10 @@
# define PYBIND11_COMPILER_TYPE "gcc_cygwin" # define PYBIND11_COMPILER_TYPE "gcc_cygwin"
# elif defined(_MSC_VER) # elif defined(_MSC_VER)
# define PYBIND11_COMPILER_TYPE "msvc" # define PYBIND11_COMPILER_TYPE "msvc"
# elif defined(__GLIBC__) \ # elif defined(__APPLE__)
&& (defined(__INTEL_COMPILER) || defined(__clang__) || defined(__GNUC__))
// // Compatibility is determined based on libstdc++ or libc++ ABI version (below).
# define PYBIND11_COMPILER_TYPE "glibc"
# elif defined(__APPLE__) \
&& (defined(__INTEL_COMPILER) || defined(__clang__) || defined(__GNUC__))
// // Compatibility is (usually) determined based on libc++ ABI version (below).
# define PYBIND11_COMPILER_TYPE "macos" # define PYBIND11_COMPILER_TYPE "macos"
# elif defined(__GLIBC__) || defined(_GLIBCXX_USE_CXX11_ABI)
# define PYBIND11_COMPILER_TYPE "glibc"
# else # else
# error "Unknown PYBIND11_COMPILER_TYPE: PLEASE REVISE THIS CODE." # error "Unknown PYBIND11_COMPILER_TYPE: PLEASE REVISE THIS CODE."
# endif # endif