mirror of
https://github.com/python/cpython.git
synced 2025-08-27 12:16:04 +00:00
gh-92906: Enable test_cext and test_cppext on Windows (#117000)
On Windows in release mode, the test_cext and test_cppext can now build C and C++ extensions. * test_cext now also builds the C extension without options. * test_cppext now also builds the C++ extension without options. * Add C++14 test to test_cppext; C++11 is not supported by MSVC. * Make setup_venv_with_pip_setuptools_wheel() quiet when support.verbose is false. Only show stdout and stderr on failure.
This commit is contained in:
parent
27cf3ed00c
commit
a114d08a89
7 changed files with 145 additions and 60 deletions
|
@ -8,10 +8,8 @@
|
|||
|
||||
#include "Python.h"
|
||||
|
||||
#if __cplusplus >= 201103
|
||||
# define NAME _testcpp11ext
|
||||
#else
|
||||
# define NAME _testcpp03ext
|
||||
#ifndef MODULE_NAME
|
||||
# error "MODULE_NAME macro must be defined"
|
||||
#endif
|
||||
|
||||
#define _STR(NAME) #NAME
|
||||
|
@ -160,7 +158,7 @@ PyType_Slot VirtualPyObject_Slots[] = {
|
|||
};
|
||||
|
||||
PyType_Spec VirtualPyObject_Spec = {
|
||||
/* .name */ STR(NAME) ".VirtualPyObject",
|
||||
/* .name */ STR(MODULE_NAME) ".VirtualPyObject",
|
||||
/* .basicsize */ sizeof(VirtualPyObject),
|
||||
/* .itemsize */ 0,
|
||||
/* .flags */ Py_TPFLAGS_DEFAULT,
|
||||
|
@ -240,7 +238,7 @@ PyDoc_STRVAR(_testcppext_doc, "C++ test extension.");
|
|||
|
||||
static struct PyModuleDef _testcppext_module = {
|
||||
PyModuleDef_HEAD_INIT, // m_base
|
||||
STR(NAME), // m_name
|
||||
STR(MODULE_NAME), // m_name
|
||||
_testcppext_doc, // m_doc
|
||||
0, // m_size
|
||||
_testcppext_methods, // m_methods
|
||||
|
@ -254,7 +252,7 @@ static struct PyModuleDef _testcppext_module = {
|
|||
#define FUNC_NAME(NAME) _FUNC_NAME(NAME)
|
||||
|
||||
PyMODINIT_FUNC
|
||||
FUNC_NAME(NAME)(void)
|
||||
FUNC_NAME(MODULE_NAME)(void)
|
||||
{
|
||||
return PyModuleDef_Init(&_testcppext_module);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue