Skip to content

Commit 44bd9c4

Browse files
authored
Merge pull request SRombauts#334 fix link for HAS_CODEC from linux-fan-dave/master
We only need to link the cipher version of sqlite in case of HAS_CODEC
2 parents cc66ccf + 359aae4 commit 44bd9c4

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

CMakeLists.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -240,13 +240,6 @@ if (SQLITECPP_INTERNAL_SQLITE)
240240
add_subdirectory(sqlite3)
241241
target_link_libraries(SQLiteCpp PUBLIC sqlite3)
242242
else (SQLITECPP_INTERNAL_SQLITE)
243-
find_package (SQLite3 REQUIRED)
244-
message(STATUS "Link to sqlite3 system library")
245-
target_link_libraries(SQLiteCpp PUBLIC SQLite::SQLite3)
246-
if(SQLite3_VERSION VERSION_LESS "3.19")
247-
set_target_properties(SQLiteCpp PROPERTIES COMPILE_FLAGS "-DSQLITECPP_HAS_MEM_STRUCT")
248-
endif()
249-
250243
# When using the SQLite codec, we need to link against the sqlcipher lib & include <sqlcipher/sqlite3.h>
251244
# So this gets the lib & header, and links/includes everything
252245
if(SQLITE_HAS_CODEC)
@@ -284,6 +277,13 @@ else (SQLITECPP_INTERNAL_SQLITE)
284277
target_include_directories(SQLiteCpp PRIVATE "${sqlcipher_INCLUDE_DIR}/sqlcipher")
285278
target_link_libraries(SQLiteCpp PRIVATE ${sqlcipher_LIBRARY})
286279
endif()
280+
else()
281+
find_package (SQLite3 REQUIRED)
282+
message(STATUS "Link to sqlite3 system library")
283+
target_link_libraries(SQLiteCpp PUBLIC SQLite::SQLite3)
284+
if(SQLite3_VERSION VERSION_LESS "3.19")
285+
set_target_properties(SQLiteCpp PROPERTIES COMPILE_FLAGS "-DSQLITECPP_HAS_MEM_STRUCT")
286+
endif()
287287
endif()
288288
endif (SQLITECPP_INTERNAL_SQLITE)
289289

0 commit comments

Comments
 (0)