summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorOlle Liljenzin <olle@liljenzin.se>2021-04-28 20:22:53 +0200
committerGitHub <noreply@github.com>2021-04-28 20:22:53 +0200
commit53b54bd6fba900842b1bd0939fb9f9616807515d (patch)
treea95dffff702fb2b505d9805000efc672fdee500c /cmake
parent97f42b963e1d82f038990e11cc81c21bd7743011 (diff)
downloadccache-53b54bd6fba900842b1bd0939fb9f9616807515d.tar.gz
Fix detection of pthread features (#840)
Add the -pthread flag to the compiler when building the test program. Otherwise the compiler will build with wrong defines. Fixes failing unit tests in Ubuntu 18.04.
Diffstat (limited to 'cmake')
-rw-r--r--cmake/GenerateConfigurationFile.cmake4
1 files changed, 2 insertions, 2 deletions
diff --git a/cmake/GenerateConfigurationFile.cmake b/cmake/GenerateConfigurationFile.cmake
index 6e6b6048..a4605293 100644
--- a/cmake/GenerateConfigurationFile.cmake
+++ b/cmake/GenerateConfigurationFile.cmake
@@ -44,7 +44,7 @@ foreach(func IN ITEMS ${functions})
endforeach()
include(CheckCSourceCompiles)
-set(CMAKE_REQUIRED_LINK_OPTIONS -pthread)
+set(CMAKE_REQUIRED_FLAGS -pthread)
check_c_source_compiles(
[=[
#include <pthread.h>
@@ -57,7 +57,7 @@ check_c_source_compiles(
]=]
HAVE_PTHREAD_MUTEX_ROBUST)
check_function_exists(pthread_mutexattr_setpshared HAVE_PTHREAD_MUTEXATTR_SETPSHARED)
-set(CMAKE_REQUIRED_LINK_OPTIONS)
+set(CMAKE_REQUIRED_FLAGS)
include(CheckStructHasMember)
check_struct_has_member("struct stat" st_ctim sys/stat.h