From a1ed1dfa34b5daa3e016537197cc531f128880bf Mon Sep 17 00:00:00 2001 From: Chris Marslender Date: Wed, 6 Mar 2024 22:58:30 -0600 Subject: [PATCH] -pthread flag doesn't apply to windows --- src/CMakeLists.txt | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 93096ede..67d29bac 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -44,7 +44,7 @@ else() ) endif() -set (CMAKE_CXX_FLAGS "-std=c++1z") +set (CMAKE_CXX_FLAGS "-std=c++17") # CMake 3.14+ include(FetchContent) @@ -66,8 +66,13 @@ add_executable(verifier_test ${CMAKE_CURRENT_SOURCE_DIR}/refcode/lzcnt.c ) -target_link_libraries(chiavdf PRIVATE ${GMP_LIBRARIES} ${GMPXX_LIBRARIES} -pthread) -target_link_libraries(verifier_test ${GMP_LIBRARIES} ${GMPXX_LIBRARIES} -pthread) +target_link_libraries(chiavdf PRIVATE ${GMP_LIBRARIES} ${GMPXX_LIBRARIES}) +target_link_libraries(verifier_test PRIVATE ${GMP_LIBRARIES} ${GMPXX_LIBRARIES}) + +if(UNIX) + target_link_libraries(chiavdf PRIVATE -pthread) + target_link_libraries(verifier_test PRIVATE -pthread) +endif() if(BUILD_CHIAVDFC) add_library(chiavdfc_shared SHARED