From 4c741ff80decda505ba81a26e096e44cdf496430 Mon Sep 17 00:00:00 2001 From: Isaiah Norton Date: Tue, 15 May 2018 11:48:07 -0400 Subject: [PATCH] Fix sqlite3 import by matching upstream build option for load_extension Per upstream documentation: > The sqlite3 module is not built with loadable extension support by > default, because some platforms (notably Mac OS X) have SQLite > libraries which are compiled without this feature. To get loadable > extension support, you must modify setup.py and remove the line that > sets SQLITE_OMIT_LOAD_EXTENSION. which means that SQLITE_OMIT_LOAD_EXTENSION is added as a compile definition by default in the upstream build system. We match that here to fix `import sqlite3`. --- cmake/extensions/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/extensions/CMakeLists.txt b/cmake/extensions/CMakeLists.txt index 8c12e0dce..301c9f226 100644 --- a/cmake/extensions/CMakeLists.txt +++ b/cmake/extensions/CMakeLists.txt @@ -640,7 +640,7 @@ add_python_extension(_sqlite3 _sqlite/row.c _sqlite/statement.c _sqlite/util.c - DEFINITIONS MODULE_NAME="sqlite3" + DEFINITIONS MODULE_NAME="sqlite3" SQLITE_OMIT_LOAD_EXTENSION=1 INCLUDEDIRS ${SQLITE3_INCLUDE_PATH} LIBRARIES ${SQLITE3_LIBRARY} )