From 5d984cb368ef357e899a23dec1c9eeae9a203fcd Mon Sep 17 00:00:00 2001 From: David Sansome Date: Fri, 10 Sep 2010 20:04:52 +0000 Subject: [PATCH] Compile with a static sqlite by default, since Qt 4.7 doesn't seem to expose the symbols we need to use FTS --- CMakeLists.txt | 17 +++-------------- cmake/sqlite3_fts_test.cpp | 32 -------------------------------- 2 files changed, 3 insertions(+), 46 deletions(-) delete mode 100644 cmake/sqlite3_fts_test.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index bacfd96c3..23cf6126f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -148,20 +148,9 @@ if(ENABLE_VISUALISATIONS) endif(USE_SYSTEM_PROJECTM) endif(ENABLE_VISUALISATIONS) -# Test whether libsqlite3 is available and if FTS3 is enabled in it -if(WIN32 OR APPLE) - option(STATIC_SQLITE "Compile and use a static sqlite3 library" ON) -else(WIN32 OR APPLE) - try_run(FTS_TEST_RUN FTS_TEST_COMPILE - ${CMAKE_CURRENT_BINARY_DIR}/sqlite3_fts_test - ${CMAKE_SOURCE_DIR}/cmake/sqlite3_fts_test.cpp - CMAKE_FLAGS "-DLINK_LIBRARIES:STRING=sqlite3") - if(NOT FTS_TEST_COMPILE OR FTS_TEST_RUN EQUAL 1 OR FTS_TEST_RUN STREQUAL "FAILED_TO_RUN") - option(STATIC_SQLITE "Compile and use a static sqlite3 library" ON) - else(NOT FTS_TEST_COMPILE OR FTS_TEST_RUN EQUAL 1 OR FTS_TEST_RUN STREQUAL "FAILED_TO_RUN") - option(STATIC_SQLITE "Compile and use a static sqlite3 library" OFF) - endif(NOT FTS_TEST_COMPILE OR FTS_TEST_RUN EQUAL 1 OR FTS_TEST_RUN STREQUAL "FAILED_TO_RUN") -endif(WIN32 OR APPLE) +# We compile our own qsqlite3 by default now, because in Qt 4.7 the symbols we +# need from it are private. +option(STATIC_SQLITE "Compile and use a static sqlite3 library" ON) set(HAVE_STATIC_SQLITE ${STATIC_SQLITE}) if(STATIC_SQLITE) diff --git a/cmake/sqlite3_fts_test.cpp b/cmake/sqlite3_fts_test.cpp deleted file mode 100644 index 7e4873b84..000000000 --- a/cmake/sqlite3_fts_test.cpp +++ /dev/null @@ -1,32 +0,0 @@ -/* This file is part of Clementine. - - Clementine is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - Clementine is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Clementine. If not, see . -*/ - -#include - -int main(int argc, char** argv) { - sqlite3* db; - - int ret = sqlite3_open(":memory:", &db); - if (ret) - return 1; - - char* error = 0; - ret = sqlite3_exec(db, "CREATE VIRTUAL TABLE foo USING fts3()", 0, 0, &error); - if (ret != SQLITE_OK) - return 1; - - return 0; -}