Skip to content

Commit fdcd0ea

Browse files
committed
Merge branch 'master' into compat_wrap_include_python_h
This merge commit required manual intervention to integrate the changes from #4953
2 parents 31906ae + ec9c268 commit fdcd0ea

File tree

2 files changed

+38
-6
lines changed

2 files changed

+38
-6
lines changed

.github/workflows/ci.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,24 @@ jobs:
6565
# Inject a couple Windows 2019 runs
6666
- runs-on: windows-2019
6767
python: '3.9'
68+
# Inject a few runs with different runtime libraries
69+
- runs-on: windows-2022
70+
python: '3.9'
71+
args: >
72+
-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded
73+
- runs-on: windows-2022
74+
python: '3.10'
75+
args: >
76+
-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDLL
77+
# This needs a python built with MTd
78+
# - runs-on: windows-2022
79+
# python: '3.11'
80+
# args: >
81+
# -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDebug
82+
- runs-on: windows-2022
83+
python: '3.12'
84+
args: >
85+
-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDebugDLL
6886
# Extra ubuntu latest job
6987
- runs-on: ubuntu-latest
7088
python: '3.11'

include/pybind11/compat/pybind11_platform_abi_id.h

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,29 @@
5353
# endif
5454
#endif
5555

56-
// On Linux/OSX, changes in __GXX_ABI_VERSION__ indicate ABI incompatibility.
57-
// On MSVC, changes in _MSC_VER may indicate ABI incompatibility (#2898).
5856
#ifndef PYBIND11_BUILD_ABI
59-
# if defined(__GXX_ABI_VERSION)
57+
# if defined(__GXX_ABI_VERSION) // Linux/OSX.
6058
# define PYBIND11_BUILD_ABI "_cxxabi" PYBIND11_PLATFORM_ABI_ID_TOSTRING(__GXX_ABI_VERSION)
61-
# elif defined(_MSC_VER)
62-
# define PYBIND11_BUILD_ABI "_mscver" PYBIND11_PLATFORM_ABI_ID_TOSTRING(_MSC_VER)
59+
# elif defined(_MSC_VER) // See PR #4953.
60+
# if defined(_MT) && defined(_DLL) // Corresponding to CL command line options /MD or /MDd.
61+
# if (_MSC_VER) / 100 == 19
62+
# define PYBIND11_BUILD_ABI "_md_mscver19"
63+
# else
64+
# error "Unknown major version for MSC_VER: PLEASE REVISE THIS CODE."
65+
# endif
66+
# elif defined(_MT) // Corresponding to CL command line options /MT or /MTd.
67+
# define PYBIND11_BUILD_ABI "_mt_mscver" PYBIND11_PLATFORM_ABI_ID_TOSTRING(_MSC_VER)
68+
# else
69+
# if (_MSC_VER) / 100 == 19
70+
# define PYBIND11_BUILD_ABI "_none_mscver19"
71+
# else
72+
# error "Unknown major version for MSC_VER: PLEASE REVISE THIS CODE."
73+
# endif
74+
# endif
75+
# elif defined(__NVCOMPILER) // NVHPC (PGI-based).
76+
# define PYBIND11_BUILD_ABI "" // TODO: What should be here, to prevent UB?
6377
# else
64-
# define PYBIND11_BUILD_ABI ""
78+
# error "Unknown platform or compiler: PLEASE REVISE THIS CODE."
6579
# endif
6680
#endif
6781

0 commit comments

Comments
 (0)