aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2018-07-04 11:45:25 -0500
committerDimitri Stolnikov <horiz0n@gmx.net>2018-08-15 19:52:23 +0200
commit0b5c3911f7bfebd176aaeeb865a12544ee1e6b9e (patch)
tree8c4334b975e9b71ef57d6a2ff1a0ae94fd9a8321
parentea1fc34766dd1231feba9e917ece5d1e2f68cce0 (diff)
link with pthreads only when using gcc
Fix from c98be5dd for MSVC which does not require pthreads for boost threading library. Under gcc -pthread adds support for multithreading with the pthreads library.
-rw-r--r--lib/CMakeLists.txt6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
index 4f83f72..dbb175a 100644
--- a/lib/CMakeLists.txt
+++ b/lib/CMakeLists.txt
@@ -43,7 +43,11 @@ GR_OSMOSDR_APPEND_SRCS(
time_spec.cc
)
-list(APPEND Boost_LIBRARIES pthread)
+#-pthread Adds support for multithreading with the pthreads library.
+#This option sets flags for both the preprocessor and linker. (man gcc)
+if(CMAKE_COMPILER_IS_GNUCXX)
+ list(APPEND Boost_LIBRARIES -pthread)
+endif()
GR_OSMOSDR_APPEND_LIBS(
${Boost_LIBRARIES}