Skip to content

Commit 7b3f01d

Browse files
lukasstadlertimfel
authored andcommitted
enable sqlite3 on Windows and avoid unresolved symbol
1 parent 650d0c8 commit 7b3f01d

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,12 +174,12 @@ simple_native_module("_mmap")
174174
simple_native_module("_cpython_sre")
175175
simple_native_module("_cpython_unicodedata")
176176
simple_native_module("_cpython_struct")
177+
simple_native_module("_sqlite3")
177178

178179
if(NOT WIN32)
179180
native_module("_testcapi" FALSE "${SRC_DIR}/modules/_testcapi.c")
180181
simple_native_module("_testmultiphase")
181182
simple_native_module("_ctypes_test")
182-
simple_native_module("_sqlite3")
183183

184184
###################### BZIP2 ########################
185185
if(DEFINED LIBBZ2_BUILD_FILE)

graalpython/com.oracle.graal.python.cext/modules/_sqlite/module.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,10 @@ PyMODINIT_FUNC PyInit__sqlite3(void)
420420
goto error;
421421
}
422422

423-
if (PyModule_AddStringConstant(module, "sqlite_version", sqlite3_libversion())) {
423+
/**
424+
* GraalPy change: use SQLITE_VERSION from builtin sqlite3
425+
*/
426+
if (PyModule_AddStringConstant(module, "sqlite_version", SQLITE_VERSION)) {
424427
goto error;
425428
}
426429

graalpython/com.oracle.graal.python.cext/modules/_sqlite3.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@
3939
* SOFTWARE.
4040
*/
4141

42+
// prevent unresolved symbols
43+
#define SQLITE_EXTERN
44+
4245
#include "_sqlite/cache.c"
4346
#include "_sqlite/connection.c"
4447
#include "_sqlite/cursor.c"

0 commit comments

Comments
 (0)