Skip to content

Commit

Permalink
Don't use pthreads if they are not available
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaut committed Jun 29, 2015
1 parent 0332284 commit 7859f81
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7859f81

Please sign in to comment.