summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-04-08 11:48:11 (GMT)
committerKitware Robot <kwrobot@kitware.com>2021-04-08 11:48:18 (GMT)
commitce97e2bdcb015dd5ee2870a7beae48add3cb1807 (patch)
tree73e82aa195114ba4ae72d3970adf1da7b1558e5f /Modules
parente1c054105ba7576094ab2687b4dfaa428dfa90db (diff)
parentd6da6784bfdb59456942d11d476593906945adbb (diff)
downloadCMake-ce97e2bdcb015dd5ee2870a7beae48add3cb1807.zip
CMake-ce97e2bdcb015dd5ee2870a7beae48add3cb1807.tar.gz
CMake-ce97e2bdcb015dd5ee2870a7beae48add3cb1807.tar.bz2
Merge topic 'find_threads_only_log_on_failure'
d6da6784bf FindThreads: Reduce amount of false positive error logging Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5988
Diffstat (limited to 'Modules')
-rw-r--r--Modules/FindThreads.cmake14
1 files changed, 10 insertions, 4 deletions
diff --git a/Modules/FindThreads.cmake b/Modules/FindThreads.cmake
index 87e88bc..28dffc0 100644
--- a/Modules/FindThreads.cmake
+++ b/Modules/FindThreads.cmake
@@ -119,7 +119,10 @@ macro(_check_pthreads_flag)
${CMAKE_BINARY_DIR}
${_threads_src}
CMAKE_FLAGS -DLINK_LIBRARIES:STRING=-pthread
- OUTPUT_VARIABLE OUTPUT)
+ OUTPUT_VARIABLE _cmake_check_pthreads_output)
+
+ string(APPEND _cmake_find_threads_output "${_cmake_check_pthreads_output}")
+ unset(_cmake_check_pthreads_output)
unset(_threads_src)
if(THREADS_HAVE_PTHREAD_ARG)
@@ -127,9 +130,6 @@ macro(_check_pthreads_flag)
message(CHECK_PASS "yes")
else()
message(CHECK_FAIL "no")
- file(APPEND
- ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
- "Determining if compiler accepts -pthread failed with the following output:\n${OUTPUT}\n\n")
endif()
endif()
@@ -249,4 +249,10 @@ if(THREADS_FOUND AND NOT TARGET Threads::Threads)
if(CMAKE_THREAD_LIBS_INIT)
set_property(TARGET Threads::Threads PROPERTY INTERFACE_LINK_LIBRARIES "${CMAKE_THREAD_LIBS_INIT}")
endif()
+elseif(NOT THREADS_FOUND AND _cmake_find_threads_output)
+ file(APPEND
+ ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+ "Determining if compiler accepts -pthread failed with the following output:\n${_cmake_find_threads_output}\n\n")
endif()
+
+unset(_cmake_find_threads_output)