From 2667eda785009e075a12e4d291bff7e6fd08f54d Mon Sep 17 00:00:00 2001 From: Paul Elliott Date: Wed, 29 Nov 2023 15:53:00 +0000 Subject: [PATCH] Explicitly link tests with pthreads Required to use pthreads within tests. Signed-off-by: Paul Elliott --- tests/CMakeLists.txt | 3 +++ tests/Makefile | 1 + 2 files changed, 4 insertions(+) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 0869aaa01..68bc57f5a 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,5 +1,8 @@ +find_package(Threads) + set(libs ${mbedtls_target} + ${CMAKE_THREAD_LIBS_INIT} ) # Set the project root directory if it's not already defined, as may happen if diff --git a/tests/Makefile b/tests/Makefile index 2249a55df..bcc3b9307 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -57,6 +57,7 @@ else DLEXT ?= so EXEXT= SHARED_SUFFIX= +LOCAL_LDFLAGS += -lpthread endif ifdef WINDOWS