Don't use pthreads if they are not available

This commit is contained in:
vitaut 2015-06-29 07:34:30 -07:00
parent 0332284ce3
commit 7859f81233

View File

@ -119,7 +119,11 @@ add_library(gmock STATIC
gmock/gmock-gtest-all.cc gmock/gmock/gmock.h
gmock/gtest/gtest.h gmock/gtest/gtest-spi.h)
find_package(Threads)
target_link_libraries(gmock ${CMAKE_THREAD_LIBS_INIT})
if (Threads_FOUND)
target_link_libraries(gmock ${CMAKE_THREAD_LIBS_INIT})
else ()
target_compile_definitions(gmock PUBLIC GTEST_HAS_PTHREAD=0)
endif ()
# Check if variadic templates are working and not affected by GCC bug 39653:
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=39653