Compare commits

...

7 Commits

Author SHA1 Message Date
Ralf W. Grosse-Kunstleve
f5eb064544
Merge 271720fde9 into 83b92ceb35 2024-11-20 20:11:39 -05:00
Marcus D. Hanwell
271720fde9 Error if _GLIBCXX_USE_CXX11_ABI is not defined
Within the `__GXX_ABI_VERSION` block this should always be defined,
guard against unexpected defines and make the error obvious.
2024-11-20 20:10:08 -05:00
Marcus D. Hanwell
476c322fec Use gxx_abi_1xxx and simplify the Clang string
After discussions with Ralf Grosse-Kunstleve we think these would make
good identifiers that are concise and clear.
2024-11-20 19:47:52 -05:00
pre-commit-ci[bot]
8369fdce4b style: pre-commit fixes 2024-11-20 21:39:53 +00:00
Marcus D. Hanwell
b72c42d489 Include GXX_ABI and USE_CXX in the identifier
Further constrain to GXX_ABI 1002 or greater and less than 2000,
hopefully future proof by summarizing that as `1` along with CXX11 on or
off.
2024-11-20 16:37:16 -05:00
Ralf W. Grosse-Kunstleve
e46982c2f0
Merge branch 'master' into pybind11_platform_abi_id_cont 2024-11-18 09:06:39 -08:00
Ralf W. Grosse-Kunstleve
14f8425ce6
THIS IS JUST A START: First attempt to combine information from PR #4953 and PR #5437 2024-11-10 15:27:14 -08:00

View File

@ -54,9 +54,7 @@
#endif #endif
#ifndef PYBIND11_BUILD_ABI #ifndef PYBIND11_BUILD_ABI
# if defined(__GXX_ABI_VERSION) // Linux/OSX. # if defined(_MSC_VER) // See PR #4953.
# define PYBIND11_BUILD_ABI "_cxxabi" PYBIND11_PLATFORM_ABI_ID_TOSTRING(__GXX_ABI_VERSION)
# elif defined(_MSC_VER) // See PR #4953.
# if defined(_MT) && defined(_DLL) // Corresponding to CL command line options /MD or /MDd. # if defined(_MT) && defined(_DLL) // Corresponding to CL command line options /MD or /MDd.
# if (_MSC_VER) / 100 == 19 # if (_MSC_VER) / 100 == 19
# define PYBIND11_BUILD_ABI "_md_mscver19" # define PYBIND11_BUILD_ABI "_md_mscver19"
@ -74,6 +72,18 @@
# endif # endif
# elif defined(__NVCOMPILER) // NVHPC (PGI-based). # elif defined(__NVCOMPILER) // NVHPC (PGI-based).
# define PYBIND11_BUILD_ABI "" // TODO: What should be here, to prevent UB? # define PYBIND11_BUILD_ABI "" // TODO: What should be here, to prevent UB?
# elif defined(_LIBCPP_ABI_VERSION) // https://libcxx.llvm.org/DesignDocs/ABIVersioning.html
# define PYBIND11_BUILD_ABI "_abi" PYBIND11_PLATFORM_ABI_ID_TOSTRING(_LIBCPP_ABI_VERSION)
# elif defined(__GXX_ABI_VERSION)
# if __GXX_ABI_VERSION >= 1002 && __GXX_ABI_VERSION < 2000
# if !defined(_GLIBCXX_USE_CXX11_ABI)
# error "UNEXPECTED: _GLIBCXX_USE_CXX11_ABI not defined"
# endif
# define PYBIND11_BUILD_ABI \
"_gxx_abi_1xxx_usecxx11_" PYBIND11_PLATFORM_ABI_ID_TOSTRING(_GLIBCXX_USE_CXX11_ABI)
# else
# error "Unknown platform or compiler (__GXX_ABI_VERSION): PLEASE REVISE THIS CODE."
# endif
# else # else
# error "Unknown platform or compiler: PLEASE REVISE THIS CODE." # error "Unknown platform or compiler: PLEASE REVISE THIS CODE."
# endif # endif