Skip to content

Commit f364830

Browse files
committed
enable testing C extensions on windows
1 parent d9f71c6 commit f364830

File tree

2 files changed

+22
-9
lines changed

2 files changed

+22
-9
lines changed

graalpython/com.oracle.graal.python.cext/CMakeLists.txt

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,13 @@ if (MSVC)
8080
/wd4710 # 'fprintf': function not inlined
8181
/wd4706 # assignment within conditional expression
8282
/wd4774 # 'sprintf': format string expected in argument 2 is not a string literal
83+
/wd4191 # unsafe conversion from 'PyObject *(__cdecl *)(MatchObject *,PyObject *const *,Py_ssize_t)' to 'void (__cdecl *)(void)'
84+
/wd4574 # sqlite, expat: 'SQLITE_ATOMIC_INTRINSICS' is defined to be '0': did you mean to use '#if SQLITE_ATOMIC_INTRINSICS'?
8385

8486
# Some that I'm not so happy about
8587
/wd4232 # sre: nonstandard extension used: 'ml_meth': address of dllimport 'Py_GenericAlias' is not static, identity not guaranteed
86-
/wd4191 # sre and sqlite: 'type cast': like unsafe conversion from 'PyObject *(__cdecl *)(MatchObject *,PyObject *const *,Py_ssize_t)' to 'void (__cdecl *)(void)'
8788
/wd4918 # sre: invalid character in pragma optimization list
88-
/wd4701 # cpython_unicodedata: potentially uninitialized local variable 'rc' used
8989
/wd4703 # unicodeobject.c:potentially uninitialized local pointer variable used
90-
/wd4574 # sqlite: 'SQLITE_ATOMIC_INTRINSICS' is defined to be '0': did you mean to use '#if SQLITE_ATOMIC_INTRINSICS'?
9190
/wd4310 # xmlparse: cast truncates constant value
9291
/wd4777 # format string '%zd' requires an argument of type 'unsigned __int64'
9392
)
@@ -222,6 +221,9 @@ endfunction()
222221
add_library(${TARGET_LIBPYTHON} SHARED)
223222
native_module("_cpython_sre" TRUE "${SRC_DIR}/modules/_cpython_sre/sre.c")
224223
simple_native_module("_cpython_unicodedata")
224+
if(WIN32)
225+
target_compile_options("_cpython_unicodedata" PRIVATE /wd4701)
226+
endif()
225227
if(NOT WIN32)
226228
simple_native_module("termios")
227229
endif()
@@ -299,13 +301,19 @@ set(TESTCAPI_SRC
299301
"${SRC_DIR}/modules/_testcapi.c"
300302
)
301303

302-
if(NOT WIN32)
303-
native_module("_testcapi" FALSE "${TESTCAPI_SRC}")
304-
simple_native_module("_testbuffer")
305-
simple_native_module("_testmultiphase")
306-
simple_native_module("_testsinglephase")
307-
simple_native_module("_ctypes_test")
304+
native_module("_testcapi" FALSE "${TESTCAPI_SRC}")
305+
if(WIN32)
306+
target_compile_options("_testcapi" PRIVATE /wd4296)
307+
endif()
308+
simple_native_module("_testbuffer")
309+
if(WIN32)
310+
target_compile_options("_testbuffer" PRIVATE /wd4090)
311+
endif()
312+
simple_native_module("_testmultiphase")
313+
simple_native_module("_testsinglephase")
314+
simple_native_module("_ctypes_test")
308315

316+
if(NOT WIN32)
309317
###################### BZIP2 ########################
310318
if(DEFINED LIBBZ2_BUILD_FILE)
311319
include("${LIBBZ2_BUILD_FILE}")

mx.graalpython/suite.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -680,6 +680,11 @@
680680
"bin/modules/_cpython_sre<graalpy_ext>",
681681
"bin/modules/_cpython_unicodedata<graalpy_ext>",
682682
"bin/modules/_sha3<graalpy_ext>",
683+
"bin/modules/_testcapi<graalpy_ext>",
684+
"bin/modules/_testbuffer<graalpy_ext>",
685+
"bin/modules/_testmultiphase<graalpy_ext>",
686+
"bin/modules/_testsinglephase<graalpy_ext>",
687+
"bin/modules/_ctypes_test<graalpy_ext>",
683688
"bin/modules/pyexpat<graalpy_ext>",
684689
],
685690
},

0 commit comments

Comments
 (0)