Add pthread library to linker list when needed
authorNate Rosenblum <flander@gmail.com>
Sun, 6 Sep 2015 15:09:29 +0000 (08:09 -0700)
committerNate Rosenblum <flander@gmail.com>
Sun, 6 Sep 2015 15:09:36 +0000 (08:09 -0700)
CMakeLists.txt

index ecb1355..d0780c4 100644 (file)
@@ -376,6 +376,10 @@ if (UNWIND_LIBRARY)
   target_link_libraries (glog PUBLIC ${UNWIND_LIBRARY})
 endif (UNWIND_LIBRARY)
 
+if (HAVE_PTHREAD)
+  target_link_libraries (glog PUBLIC ${CMAKE_THREAD_LIBS_INIT})
+endif (HAVE_PTHREAD)
+
 if (WIN32 AND HAVE_SNPRINTF)
   set_property (SOURCE src/windows/port.cc APPEND PROPERTY COMPILE_DEFINITIONS
     HAVE_SNPRINTF)