From d0894468650ef964248b5d879d222db4b367c852 Mon Sep 17 00:00:00 2001 From: Yoshio Soma Date: Mon, 23 Oct 2023 14:06:18 +0900 Subject: [PATCH] Use find_package for pthread dependency. --- contrib/CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/contrib/CMakeLists.txt b/contrib/CMakeLists.txt index e2932f8..a5909e8 100644 --- a/contrib/CMakeLists.txt +++ b/contrib/CMakeLists.txt @@ -13,6 +13,9 @@ include(GNUInstallDirs) # Set C++11 as default standard set(CMAKE_CXX_STANDARD 11) +set(THREADS_PREFER_PTHREAD_FLAG ON) +find_package(Threads REQUIRED) + get_filename_component(gemmlowp_src ${gemmlowp_SOURCE_DIR} PATH) if(WIN32) @@ -24,7 +27,7 @@ if(WIN32) add_definitions(-DGEMMLOWP_ALLOW_INLINE_ASM) endif() else() - set(EXTERNAL_LIBRARIES "pthread") + set(EXTERNAL_LIBRARIES Threads::Threads) endif() # Glob header files