Fix compile without built-in qsqlite

This commit is contained in:
Jonas Kvinge 2018-05-04 19:16:08 +02:00
parent 0af0af2415
commit 99868323d7
4 changed files with 7 additions and 7 deletions

View File

@ -282,14 +282,16 @@ list(REMOVE_ITEM QT_LIBRARIES "-lGLU -lGL")
# QSqlLiteDriver: # QSqlLiteDriver:
# We do this because we can't guarantee that the driver shipped with Qt exposes the raw sqlite3 functions required for FTS support. # 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. # 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.
option(USE_SYSTEM_QSQLITE "Don't set this unless you can guarantee that the driver shipped with Qt exposes the raw sqlite3 functions required for FTS support" OFF) option(USE_SYSTEM_QSQLITE "Don't set this unless you can guarantee that the driver shipped with Qt exposes the raw sqlite3 functions required for FTS support" ON)
if(USE_SYSTEM_QSQLITE) if(USE_SYSTEM_QSQLITE)
message(STATUS "Using system qsqlite driver") message(STATUS "Using system qsqlite driver")
set(USE_SYSTEM_QSQLITE ON)
else(USE_SYSTEM_QSQLITE) else(USE_SYSTEM_QSQLITE)
message(STATUS "Using builtin qsqlite driver") message(STATUS "Using builtin qsqlite driver")
add_subdirectory(3rdparty/qsqlite) add_subdirectory(3rdparty/qsqlite)
set(QSQLITE_LIBRARIES qsqlite) set(QSQLITE_LIBRARIES qsqlite)
set(QSQLITE_INCLUDE_DIRS "3rdparty/qsqlite") set(QSQLITE_INCLUDE_DIRS "3rdparty/qsqlite")
set(USE_SYSTEM_QSQLITE OFF)
endif(USE_SYSTEM_QSQLITE) endif(USE_SYSTEM_QSQLITE)
# When/if upstream accepts our patches then these options can be used to link to system installed qtsingleapplication instead. # When/if upstream accepts our patches then these options can be used to link to system installed qtsingleapplication instead.

View File

@ -853,6 +853,7 @@ target_link_libraries(strawberry_lib
${QTSINGLEAPPLICATION_LIBRARIES} ${QTSINGLEAPPLICATION_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT} ${CMAKE_THREAD_LIBS_INIT}
${SQLITE_LIBRARIES} ${SQLITE_LIBRARIES}
${QSQLITE_LIBRARIES}
z z
Qocoa Qocoa
) )
@ -891,10 +892,6 @@ if(HAVE_LIBMTP)
target_link_libraries(strawberry_lib ${LIBMTP_LIBRARIES}) target_link_libraries(strawberry_lib ${LIBMTP_LIBRARIES})
endif(HAVE_LIBMTP) endif(HAVE_LIBMTP)
#if(HAVE_LIBINDICATE)
# target_link_libraries(strawberry_lib ${INDICATEQT_LIBRARIES})
#endif(HAVE_LIBINDICATE)
if(HAVE_LIBPULSE) if(HAVE_LIBPULSE)
target_link_libraries(strawberry_lib ${LIBPULSE_LIBRARIES}) target_link_libraries(strawberry_lib ${LIBPULSE_LIBRARIES})
endif() endif()
@ -918,8 +915,6 @@ else (APPLE)
target_link_libraries(strawberry_lib ${QXT_LIBRARIES}) target_link_libraries(strawberry_lib ${QXT_LIBRARIES})
endif (APPLE) endif (APPLE)
target_link_libraries(strawberry_lib qsqlite)
if (WIN32) if (WIN32)
target_link_libraries(strawberry_lib target_link_libraries(strawberry_lib
${ZLIB_LIBRARIES} ${ZLIB_LIBRARIES}

View File

@ -38,6 +38,7 @@
#cmakedefine TAGLIB_HAS_OPUS #cmakedefine TAGLIB_HAS_OPUS
#cmakedefine USE_INSTALL_PREFIX #cmakedefine USE_INSTALL_PREFIX
#cmakedefine USE_SYSTEM_SHA2 #cmakedefine USE_SYSTEM_SHA2
#cmakedefine USE_SYSTEM_QSQLITE
#cmakedefine HAVE_GSTREAMER #cmakedefine HAVE_GSTREAMER
#cmakedefine HAVE_VLC #cmakedefine HAVE_VLC

View File

@ -82,8 +82,10 @@
#endif #endif
// Load sqlite plugin on windows and mac. // Load sqlite plugin on windows and mac.
#ifndef USE_SYSTEM_QSQLITE
#include <QtPlugin> #include <QtPlugin>
Q_IMPORT_PLUGIN(QSQLiteDriverPlugin) Q_IMPORT_PLUGIN(QSQLiteDriverPlugin)
#endif
int main(int argc, char* argv[]) { int main(int argc, char* argv[]) {