From b1f67393fdac05d7d05b7f1232de688e82a7e98f Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Thu, 24 Jun 2021 20:52:28 +0100 Subject: [PATCH] It's the sqlite3 library that needs threads --- CMakeLists.txt | 7 ------- sqlite3/CMakeLists.txt | 7 +++++++ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 85c1061..ee23417 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -279,13 +279,6 @@ else (SQLITECPP_INTERNAL_SQLITE) endif() endif (SQLITECPP_INTERNAL_SQLITE) -# Link target with pthread and dl for Unix -if (UNIX) - set(THREADS_PREFER_PTHREAD_FLAG ON) - find_package(Threads REQUIRED) - target_link_libraries(SQLiteCpp PUBLIC Threads::Threads ${CMAKE_DL_LIBS}) -endif (UNIX) - # Set includes for target and transitive downstream targets target_include_directories(SQLiteCpp diff --git a/sqlite3/CMakeLists.txt b/sqlite3/CMakeLists.txt index 3cc5101..11fc871 100644 --- a/sqlite3/CMakeLists.txt +++ b/sqlite3/CMakeLists.txt @@ -11,6 +11,13 @@ add_library(sqlite3 sqlite3.h ) +# Link target with pthread and dl for Unix +if (UNIX) + set(THREADS_PREFER_PTHREAD_FLAG ON) + find_package(Threads REQUIRED) + target_link_libraries(sqlite3 PUBLIC Threads::Threads ${CMAKE_DL_LIBS}) +endif (UNIX) + target_include_directories(sqlite3 PUBLIC $ $)