Skip to content

Commit

Permalink
We only need to link the cipher version of sqlite in case of HAS_CODEC
Browse files Browse the repository at this point in the history
  • Loading branch information
David Feurle committed Jul 25, 2021
1 parent 0c46d86 commit 359aae4
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -240,13 +240,6 @@ if (SQLITECPP_INTERNAL_SQLITE)
add_subdirectory(sqlite3)
target_link_libraries(SQLiteCpp PUBLIC sqlite3)
else (SQLITECPP_INTERNAL_SQLITE)
find_package (SQLite3 REQUIRED)
message(STATUS "Link to sqlite3 system library")
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")
endif()

# When using the SQLite codec, we need to link against the sqlcipher lib & include <sqlcipher/sqlite3.h>
# So this gets the lib & header, and links/includes everything
if(SQLITE_HAS_CODEC)
Expand Down Expand Up @@ -284,6 +277,13 @@ else (SQLITECPP_INTERNAL_SQLITE)
target_include_directories(SQLiteCpp PRIVATE "${sqlcipher_INCLUDE_DIR}/sqlcipher")
target_link_libraries(SQLiteCpp PRIVATE ${sqlcipher_LIBRARY})
endif()
else()
find_package (SQLite3 REQUIRED)
message(STATUS "Link to sqlite3 system library")
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")
endif()
endif()
endif (SQLITECPP_INTERNAL_SQLITE)

Expand Down

0 comments on commit 359aae4

Please sign in to comment.