Skip to content

Commit

Permalink
fixed plugin loading test
Browse files Browse the repository at this point in the history
  • Loading branch information
gittiver committed Mar 21, 2023
1 parent af3984f commit ee6f8ca
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 14 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ set(BACKEND_DL_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/src/library)
if (LITESQL_WITH_SQLITE3)
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS HAVE_LIBSQLITE3)
option(LITESQL_USE_SYSTEM_SQLITE "use sqlite3 lib provided by system" ON)
list(APPEND BACKEND_LIBRARIES litesql_sqlite)
# list(APPEND BACKEND_LIBRARIES litesql_sqlite3)
endif (LITESQL_WITH_SQLITE3)

if (LITESQL_WITH_MYSQL AND MYSQL_FOUND)
Expand Down
14 changes: 3 additions & 11 deletions src/library/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -91,17 +91,9 @@ else(LITESQL_USE_SYSTEM_SQLITE AND SQLITE3_FOUND)
endif(LITESQL_USE_SYSTEM_SQLITE AND SQLITE3_FOUND)

if (LITESQL_WITH_SQLITE3)
target_sources(${LIBNAME}
PRIVATE
sqlite3/sqlite3_backend.cpp)
target_include_directories(${LIBNAME}
PRIVATE
${SQLITE3_INCLUDE_DIR}
)
target_link_directories(${LIBNAME}
PUBLIC
${SQLITE3_LIBRARIY_DIR}
)
target_sources(${LIBNAME} PRIVATE sqlite3/sqlite3_backend.cpp)
target_include_directories(${LIBNAME} PRIVATE ${SQLITE3_INCLUDE_DIR})
target_link_directories(${LIBNAME} PUBLIC ${SQLITE3_LIBRARY_DIR})
target_link_libraries(${LIBNAME} PUBLIC ${SQLITE3_LIBRARIES})

# add_library(${LIBNAME}_sqlite STATIC
Expand Down
2 changes: 1 addition & 1 deletion src/library/sqlite3/sqlite3_backend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ SQLite3::SQLite3(const string& connInfo) noexcept(false) //throw(DatabaseError)
, beginTrans("BEGIN")
{
vector<string> params = split(connInfo,";");
string database = ":memory:";
string database;
for (size_t i = 0; i < params.size(); i++) {
vector<string> param = split(params[i], "=");
if (param.size() == 1)
Expand Down
6 changes: 5 additions & 1 deletion src/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,12 @@ set_tests_properties(test-update-table PROPERTIES
)
endif (UNIX AND NOT APPLE AND NOT WIN32)


# backend plugin related tests
if(LITESQL_WITH_BACKEND_PLUGINS)
add_executable(test-backend-loading test-backend-loading.cpp)
target_link_libraries (test-backend-loading litesql litesql-util ${BACKEND_LIBRARIES})
target_include_directories(test-backend-loading PRIVATE ../library)
add_dependencies(test-backend-loading litesql_backend_sqlite3)

add_test(test-backend-loading ${EXECUTABLE_OUTPUT_PATH}/test-backend-loading backend-loading)
Expand All @@ -53,5 +57,5 @@ set_tests_properties(test-backend-loading PROPERTIES
ENVIRONMENT "LD_LIBRARY_PATH=${BACKEND_DL_DIRECTORY}"
)
endif (UNIX AND NOT APPLE AND NOT WIN32)
endif (LITESQL_WITH_BACKEND_PLUGINS)

INCLUDE_DIRECTORIES(../library)

0 comments on commit ee6f8ca

Please sign in to comment.