Fix riscv64 build failure by linking correctly with pthread

Link with -pthread instead of -lpthread, and do that for all architectures.

Contributors:
Aurelien Jarno <aurelien@aurel32.net>

Closes: #1717
This commit is contained in:
Otto Kekäläinen 2020-12-20 20:52:51 +02:00 committed by Daniel Black
parent 13d0641710
commit cc3105e100

View File

@ -134,6 +134,7 @@ IF(UNIX)
IF(NOT LIBRT)
MY_SEARCH_LIBS(clock_gettime rt LIBRT)
ENDIF()
set(THREADS_PREFER_PTHREAD_FLAG ON)
FIND_PACKAGE(Threads)
SET(CMAKE_REQUIRED_LIBRARIES