1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83
|
commit 35172527a42f9fb5ad5b5717348d4e1b44ca11ae
Author: Antonio Russo <antonio.e.russo@gmail.com>
Date: Tue Feb 4 08:01:02 2020 -0700
Do not build QSQLite
QSQLite is not always built with FTS3 support, although it is on Debian.
To support those other distributions, Clementine ships a copy of
QSQLite, and builds it with FTS3 enabled. See this PR:
https://github.com/clementine-player/Clementine/pull/6564
Disable the embedded library, as the distribution version includes FTS3
support.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 15cc4d34c..067a55f00 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -317,14 +317,6 @@ if(HAVE_VISUALISATIONS)
endif(HAVE_VISUALISATIONS)
-# Build our copy of QSqlLiteDriver.
-# We do this because we can't guarantee that the driver shipped with Qt exposes the
-# raw sqlite3_ functions required for FTS support. This way we know that those symbols
-# exist at compile-time and that our code links to the same sqlite library as the
-# Qt driver.
-add_subdirectory(3rdparty/qsqlite)
-include_directories("3rdparty/qsqlite")
-
# When/if upstream accepts our patches then these options can be used to link
# to system installed qtsingleapplication instead.
option(USE_SYSTEM_QTSINGLEAPPLICATION "Don't set this option unless your system QtSingleApplication library has been compiled with the Clementine patches in 3rdparty" OFF)
@@ -393,6 +385,19 @@ if(GMOCK_INCLUDE_DIRS)
endif(GTEST_INCLUDE_DIRS)
endif(GMOCK_INCLUDE_DIRS)
+find_path(SQLITE_INCLUDE_DIRS sqlite3.h)
+find_library(SQLITE_LIBRARIES sqlite3)
+
+if (SQLITE_INCLUDE_DIRS AND SQLITE_LIBRARIES)
+ set(SQLITE_FOUND true)
+endif()
+
+if (NOT SQLITE_FOUND)
+ message(SEND_ERROR "Could not find sqlite3")
+endif()
+
+include_directories(${SQLITE_INCLUDE_DIRS})
+
# Use the system libmygpo-qt5 if a recent enough version was found
if(LIBMYGPO_QT5_FOUND)
set(MYGPOQT5_LIBRARIES ${LIBMYGPO_QT5_LIBRARIES})
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 0ecea33b5..a913d0c31 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1361,9 +1361,6 @@ else (APPLE)
target_link_libraries(clementine_lib ${QXT_LIBRARIES})
endif (APPLE)
-set(3RDPARTY_SQLITE_LIBRARY qsqlite)
-target_link_libraries(clementine_lib qsqlite)
-
if (WIN32)
target_link_libraries(clementine_lib
protobuf
diff --git a/src/main.cpp b/src/main.cpp
index 91f1a5c1e..38acc67ed 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -96,10 +96,6 @@ QDBusArgument& operator<<(QDBusArgument& arg, const QImage& image);
const QDBusArgument& operator>>(const QDBusArgument& arg, QImage& image);
#endif
-// Load sqlite plugin on windows and mac.
-#include <QtPlugin>
-Q_IMPORT_PLUGIN(QSQLiteDriverPlugin)
-
namespace {
void LoadTranslation(const QString& prefix, const QString& path,
|