Commit 096a49c0dc4a8aec540251a1c9a77f86ba6fa2ca

Patrick Steinhardt 2017-07-03T08:45:57

cmake: try to detect threads library While we already make use of the variable `${CMAKE_THREAD_LIBS_INIT}`, it is actually undefined due to us never including the "FindThreads" module in the CMakeLists.txt. It is rather curious as to why this has never triggered any error up to now, but it does in fact result in linking errors on some Unix platforms as soon as we split up our build instructions into multiple files. Fix the issue now to avoid future breakage by including the "FindThreads" module.

1
2
3
4
5
6
7
8
9
10
11
12
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f3b3604..d3e172b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -24,6 +24,7 @@ INCLUDE(CheckSymbolExists)
 INCLUDE(CheckStructHasMember)
 INCLUDE(AddCFlagIfSupported)
 INCLUDE(FindPkgConfig)
+INCLUDE(FindThreads)
 
 # Build options
 #