Merge pull request #721 from ilmagico/fix-mingw-threads

Fix compilation of googletest with MinGW using Win32 threads
This commit is contained in:
Billy Donahue
2016-08-24 08:15:38 -04:00
committed by GitHub
4 changed files with 20 additions and 5 deletions

View File

@@ -46,7 +46,9 @@ endmacro()
# Google Mock. You can tweak these definitions to suit your need. A
# variable's value is empty before it's explicitly assigned to.
macro(config_compiler_and_linker)
if (NOT gtest_disable_pthreads)
# Note: pthreads on MinGW is not supported, even if available
# instead, we use windows threading primitives
if (NOT gtest_disable_pthreads AND NOT MINGW)
# Defines CMAKE_USE_PTHREADS_INIT and CMAKE_THREAD_LIBS_INIT.
find_package(Threads)
endif()