mirror of
https://github.com/BlackMATov/curly.hpp.git
synced 2025-12-15 04:15:30 +07:00
add thread library link
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include <mutex>
|
||||
#include <algorithm>
|
||||
#include <functional>
|
||||
#include <condition_variable>
|
||||
|
||||
#include <curl/curl.h>
|
||||
|
||||
|
||||
@@ -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})
|
||||
|
||||
Reference in New Issue
Block a user