NOTE on macOS FindSQLite3 find an unrelated sqlite3.h from Mono.framework that doesn't match the actual package version!

This commit is contained in:
Sébastien Rombauts 2024-08-17 23:31:14 +02:00
parent 2644c311dd
commit 0f8d9125d9
2 changed files with 645 additions and 641 deletions

View File

@ -87,7 +87,7 @@ int main()
{ {
// Using SQLITE_VERSION would require #include <sqlite3.h> which we want to avoid: use SQLite::VERSION if possible. // Using SQLITE_VERSION would require #include <sqlite3.h> which we want to avoid: use SQLite::VERSION if possible.
// std::cout << "SQlite3 version " << SQLITE_VERSION << std::endl; // 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; std::cout << "SQliteC++ version " << SQLITECPP_VERSION << std::endl;
//////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////

View File

@ -34,7 +34,8 @@ void assertion_failed(const char* apFile, const long apLine, const char* apFunc,
} }
#endif #endif
#ifdef SQLITECPP_INTERNAL_SQLITE // NOTE on macOS FindSQLite3 find an unrelated sqlite3.h from Mono.framework that doesn't match the actual package version!
#if defined(SQLITECPP_INTERNAL_SQLITE) || !defined(__APPLE__)
TEST(SQLiteCpp, version) TEST(SQLiteCpp, version)
{ {
EXPECT_STREQ(SQLITE_VERSION, SQLite::VERSION); EXPECT_STREQ(SQLITE_VERSION, SQLite::VERSION);
@ -559,7 +560,10 @@ TEST(Database, getHeaderInfo)
EXPECT_EQ(h.databaseTextEncoding, 1); EXPECT_EQ(h.databaseTextEncoding, 1);
EXPECT_EQ(h.incrementalVaccumMode, 0); EXPECT_EQ(h.incrementalVaccumMode, 0);
EXPECT_EQ(h.versionValidFor, 3); EXPECT_EQ(h.versionValidFor, 3);
// NOTE on macOS FindSQLite3 find an unrelated sqlite3.h from Mono.framework that doesn't match the actual package version!
#if defined(SQLITECPP_INTERNAL_SQLITE) || !defined(__APPLE__)
EXPECT_EQ(h.sqliteVersion, SQLITE_VERSION_NUMBER); EXPECT_EQ(h.sqliteVersion, SQLITE_VERSION_NUMBER);
#endif && !defined(__APPLE__)
} }
remove("test.db3"); remove("test.db3");
} }