From 60243c3b222d7aea9e3fd4deb286021af0cfa894 Mon Sep 17 00:00:00 2001 From: Roland Schulz Date: Tue, 5 Dec 2017 12:41:18 -0800 Subject: [PATCH] Fix C++11 library check's thread dependency Test was depending on thread library without explicit linking it, which some compiler require. Fixes #2051 Change-Id: I9929d9373a4e8caa393f548d25a78bc03c016bf9 --- cmake/gmxTestCXX11.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmake/gmxTestCXX11.cmake b/cmake/gmxTestCXX11.cmake index a9d58547a7..9b559c6e20 100644 --- a/cmake/gmxTestCXX11.cmake +++ b/cmake/gmxTestCXX11.cmake @@ -33,6 +33,7 @@ # the research papers on the package. Check out http://www.gromacs.org. include(CheckCXXSourceCompiles) +include(FindThreads) # Check whether both a suitable C++11-compatible compiler and standard # library is available, and give a fatal error if not. @@ -155,7 +156,7 @@ int main() { # Now check the standard library is OK set(CMAKE_REQUIRED_FLAGS "${CXX11_CXX_FLAG} ${${STDLIB_CXX_FLAG_NAME}}") - set(CMAKE_REQUIRED_LIBRARIES "${${STDLIB_LIBRARIES_NAME}}") + set(CMAKE_REQUIRED_LIBRARIES "${${STDLIB_LIBRARIES_NAME}} ${CMAKE_THREAD_LIBS_INIT}") check_cxx_source_compiles( "#include #include -- 2.11.4.GIT