diff --git a/CMakeLists.txt b/CMakeLists.txt index b95996f4..7aea32a0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -326,7 +326,9 @@ else (SQLITECPP_INTERNAL_SQLITE) endif() else() find_package (SQLite3 REQUIRED) - message(STATUS "Link to sqlite3 system library") + message(STATUS "Link to sqlite3 system library ${SQLite3_VERSION} (${SQLite3_INCLUDE_DIRS})") + # TODO: shouldn't be needed: + include_directories(${SQLite3_INCLUDE_DIRS}) target_link_libraries(SQLiteCpp PUBLIC SQLite::SQLite3) if(SQLite3_VERSION VERSION_LESS "3.19") set_target_properties(SQLiteCpp PROPERTIES COMPILE_FLAGS "-DSQLITECPP_HAS_MEM_STRUCT") diff --git a/examples/example1/main.cpp b/examples/example1/main.cpp index 9c2b3616..c0e9a2de 100644 --- a/examples/example1/main.cpp +++ b/examples/example1/main.cpp @@ -87,7 +87,7 @@ int main() { // Using SQLITE_VERSION would require #include which we want to avoid: use SQLite::VERSION if possible. // std::cout << "SQlite3 version " << SQLITE_VERSION << std::endl; - std::cout << "SQlite3 version " << SQLite::VERSION << " (" << SQLite::getLibVersion() << ")" << std::endl; + std::cout << "SQlite3 compile time header version " << SQLite::VERSION << " (vs dynamic lib version " << SQLite::getLibVersion() << ")" << std::endl; std::cout << "SQliteC++ version " << SQLITECPP_VERSION << std::endl; //////////////////////////////////////////////////////////////////////////// diff --git a/tests/Database_test.cpp b/tests/Database_test.cpp index ec9adefa..12180d9f 100644 --- a/tests/Database_test.cpp +++ b/tests/Database_test.cpp @@ -34,7 +34,7 @@ void assertion_failed(const char* apFile, const long apLine, const char* apFunc, } #endif -#ifdef SQLITECPP_INTERNAL_SQLITE +// TODO test #ifdef SQLITECPP_INTERNAL_SQLITE TEST(SQLiteCpp, version) { EXPECT_STREQ(SQLITE_VERSION, SQLite::VERSION); @@ -42,7 +42,7 @@ TEST(SQLiteCpp, version) EXPECT_STREQ(SQLITE_VERSION, SQLite::getLibVersion()); EXPECT_EQ (SQLITE_VERSION_NUMBER, SQLite::getLibVersionNumber()); } -#endif +// TODO test #endif TEST(Database, ctorExecCreateDropExist) { @@ -559,7 +559,13 @@ TEST(Database, getHeaderInfo) EXPECT_EQ(h.databaseTextEncoding, 1); EXPECT_EQ(h.incrementalVaccumMode, 0); EXPECT_EQ(h.versionValidFor, 3); - EXPECT_EQ(h.sqliteVersion, SQLITE_VERSION_NUMBER); +// TODO on macOS it seems that the SQLITE_VERSION from sqlite3.h doesn't match the getLibVersion() from the DLL +#if defined(SQLITECPP_INTERNAL_SQLITE) && defined(__APPLE__) + EXPECT_EQ(h.sqliteVersion, static_cast(SQLite::getLibVersionNumber())); +#else + EXPECT_EQ(h.sqliteVersion, static_cast(SQLite::getLibVersionNumber())); + EXPECT_EQ(h.sqliteVersion, SQLITE_VERSION_NUMBER); +#endif && !defined(__APPLE__) } remove("test.db3"); }