Index: yubico-piv-tool-2.2.1/ykcs11/CMakeLists.txt =================================================================== --- yubico-piv-tool-2.2.1.orig/ykcs11/CMakeLists.txt +++ yubico-piv-tool-2.2.1/ykcs11/CMakeLists.txt @@ -60,6 +60,9 @@ if(${ENABLE_HARDWARE_TESTS}) set(HW_TESTS 1) endif(${ENABLE_HARDWARE_TESTS}) +set(THREADS_PREFER_PTHREAD_FLAG ON) +find_package(Threads REQUIRED) + # static library if(BUILD_STATIC_LIB) add_library(ykcs11 STATIC ${SOURCE}) @@ -73,7 +76,7 @@ endif(BUILD_STATIC_LIB) # dynamic library add_library(ykcs11_shared SHARED ${SOURCE}) -target_link_libraries(ykcs11_shared ${LIBCRYPTO_LDFLAGS} ykpiv_shared) +target_link_libraries(ykcs11_shared ${LIBCRYPTO_LDFLAGS} ykpiv_shared Threads::Threads) set_target_properties(ykcs11_shared PROPERTIES SOVERSION ${SO_VERSION} VERSION ${VERSION}) if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") set_target_properties(ykcs11_shared PROPERTIES INSTALL_RPATH "${YKPIV_INSTALL_LIB_DIR}")