mirror of
https://github.com/BlackMATov/curly.hpp.git
synced 2025-12-16 22:19:27 +07:00
add thread library link
This commit is contained in:
@@ -7,12 +7,21 @@ endif()
|
|||||||
|
|
||||||
project(curly.hpp)
|
project(curly.hpp)
|
||||||
|
|
||||||
|
find_package(Threads REQUIRED)
|
||||||
|
|
||||||
add_library(${PROJECT_NAME} STATIC
|
add_library(${PROJECT_NAME} STATIC
|
||||||
headers/curly.hpp/curly.hpp
|
headers/curly.hpp/curly.hpp
|
||||||
sources/curly.cpp)
|
sources/curly.cpp)
|
||||||
target_include_directories(${PROJECT_NAME} PUBLIC headers)
|
|
||||||
target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_17)
|
target_include_directories(${PROJECT_NAME}
|
||||||
target_link_libraries(${PROJECT_NAME} PUBLIC curl)
|
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)
|
if(BUILD_AS_STANDALONE)
|
||||||
option(BUILD_WITH_UNTESTS "Build with unit tests" ON)
|
option(BUILD_WITH_UNTESTS "Build with unit tests" ON)
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
#include <mutex>
|
#include <mutex>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
#include <condition_variable>
|
||||||
|
|
||||||
#include <curl/curl.h>
|
#include <curl/curl.h>
|
||||||
|
|
||||||
|
|||||||
@@ -55,10 +55,10 @@ endif()
|
|||||||
|
|
||||||
file(GLOB UNTESTS_SOURCES "*.cpp" "*.hpp")
|
file(GLOB UNTESTS_SOURCES "*.cpp" "*.hpp")
|
||||||
add_executable(${PROJECT_NAME} ${UNTESTS_SOURCES})
|
add_executable(${PROJECT_NAME} ${UNTESTS_SOURCES})
|
||||||
|
|
||||||
target_link_libraries(${PROJECT_NAME}
|
target_link_libraries(${PROJECT_NAME}
|
||||||
Catch2
|
nlohmann_json Catch2 curly.hpp)
|
||||||
nlohmann_json
|
|
||||||
curly.hpp)
|
|
||||||
target_compile_options(${PROJECT_NAME}
|
target_compile_options(${PROJECT_NAME}
|
||||||
PRIVATE
|
PRIVATE
|
||||||
$<$<CXX_COMPILER_ID:MSVC>:
|
$<$<CXX_COMPILER_ID:MSVC>:
|
||||||
@@ -66,4 +66,5 @@ target_compile_options(${PROJECT_NAME}
|
|||||||
PRIVATE
|
PRIVATE
|
||||||
$<$<OR:$<CXX_COMPILER_ID:GNU>,$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>:
|
$<$<OR:$<CXX_COMPILER_ID:GNU>,$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>:
|
||||||
-Wall -Wextra -Wpedantic>)
|
-Wall -Wextra -Wpedantic>)
|
||||||
|
|
||||||
add_test(${PROJECT_NAME} ${PROJECT_NAME})
|
add_test(${PROJECT_NAME} ${PROJECT_NAME})
|
||||||
|
|||||||
Reference in New Issue
Block a user