diff options
author | Olle Liljenzin <olle@liljenzin.se> | 2021-04-28 20:22:53 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-28 20:22:53 +0200 |
commit | 53b54bd6fba900842b1bd0939fb9f9616807515d (patch) | |
tree | a95dffff702fb2b505d9805000efc672fdee500c /cmake | |
parent | 97f42b963e1d82f038990e11cc81c21bd7743011 (diff) | |
download | ccache-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.cmake | 4 |
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 |