add thread library link

This commit is contained in:
2019-06-26 10:40:47 +07:00
parent 49c436ac83
commit ca02610532
3 changed files with 17 additions and 6 deletions

View File

@@ -7,12 +7,21 @@ endif()
project(curly.hpp)
find_package(Threads REQUIRED)
add_library(${PROJECT_NAME} STATIC
headers/curly.hpp/curly.hpp
sources/curly.cpp)
target_include_directories(${PROJECT_NAME} PUBLIC headers)
target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_17)
target_link_libraries(${PROJECT_NAME} PUBLIC curl)
target_include_directories(${PROJECT_NAME}
PUBLIC headers)
target_compile_features(${PROJECT_NAME}
PUBLIC cxx_std_17)
target_link_libraries(${PROJECT_NAME}
PUBLIC curl
PUBLIC Threads::Threads)
if(BUILD_AS_STANDALONE)
option(BUILD_WITH_UNTESTS "Build with unit tests" ON)

View File

@@ -13,6 +13,7 @@
#include <mutex>
#include <algorithm>
#include <functional>
#include <condition_variable>
#include <curl/curl.h>

View File

@@ -55,10 +55,10 @@ endif()
file(GLOB UNTESTS_SOURCES "*.cpp" "*.hpp")
add_executable(${PROJECT_NAME} ${UNTESTS_SOURCES})
target_link_libraries(${PROJECT_NAME}
Catch2
nlohmann_json
curly.hpp)
nlohmann_json Catch2 curly.hpp)
target_compile_options(${PROJECT_NAME}
PRIVATE
$<$<CXX_COMPILER_ID:MSVC>:
@@ -66,4 +66,5 @@ target_compile_options(${PROJECT_NAME}
PRIVATE
$<$<OR:$<CXX_COMPILER_ID:GNU>,$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>:
-Wall -Wextra -Wpedantic>)
add_test(${PROJECT_NAME} ${PROJECT_NAME})