Compare commits

...

5 Commits

Author SHA1 Message Date
Isuru Fernando 2fb9af6e5d
Merge 4ff53cf69f into 1f8b4a7f1a 2024-09-20 11:38:40 +02:00
Hintay 1f8b4a7f1a
fix(cmake): `NO_EXTRAS` in `pybind11_add_module` function partially working (#5378) 2024-09-19 11:24:35 -04:00
Isuru Fernando 4ff53cf69f
Use msvc major version 2023-11-30 17:37:07 -06:00
Isuru Fernando 485bcf54b1
Update comment about which PR 2023-11-28 12:46:48 -06:00
Isuru Fernando 0c2a8a50e7 Fix MSVC MT/MD incompatibility in PYBIND11_BUILD_ABI 2023-11-28 10:08:14 -06:00
2 changed files with 7 additions and 7 deletions

View File

@ -311,12 +311,16 @@ struct type_info {
#endif
/// On Linux/OSX, changes in __GXX_ABI_VERSION__ indicate ABI incompatibility.
/// On MSVC, changes in _MSC_VER may indicate ABI incompatibility (#2898).
/// On MSVC, mixing /MT and /MD will result in crashes. See (#4953)
#ifndef PYBIND11_BUILD_ABI
# if defined(__GXX_ABI_VERSION)
# define PYBIND11_BUILD_ABI "_cxxabi" PYBIND11_TOSTRING(__GXX_ABI_VERSION)
# elif defined(_MSC_VER)
# define PYBIND11_BUILD_ABI "_mscver" PYBIND11_TOSTRING(_MSC_VER)
# elif defined(_MSC_VER) && defined(_MT)
# define PYBIND11_BUILD_ABI "_mt_mscver" PYBIND11_TOSTRING(_MSC_VER)
# elif defined(_MSC_VER) && defined(_MD) && (_MSC_VER >= 1900) && (_MSC_VER < 2000)
# define PYBIND11_BUILD_ABI "_md_mscver14"
# elif defined(_MSC_VER) && defined(_MD)
# define PYBIND11_BUILD_ABI "_md_mscver" PYBIND11_TOSTRING(_MSC_VER)
# else
# define PYBIND11_BUILD_ABI ""
# endif

View File

@ -274,10 +274,6 @@ function(pybind11_add_module target_name)
target_link_libraries(${target_name} PRIVATE pybind11::embed)
endif()
if(MSVC)
target_link_libraries(${target_name} PRIVATE pybind11::windows_extras)
endif()
# -fvisibility=hidden is required to allow multiple modules compiled against
# different pybind versions to work properly, and for some features (e.g.
# py::module_local). We force it on everything inside the `pybind11`