Modules: Use new keyword-dispatched try_compile signature

Modify most of the modules that ship with CMake to use the new
try_compile / try_run signatures added by commit aa9220d3a0
(try_compile: Add keyword-dispatched signature, 2022-09-02). This
improves debugging by each invocation using its own directory so that
the results of multiple invocations can be retained.

This does not cover any invocations which provide an entire project, as
that flavor of try_compile has not yet been updated.
This commit is contained in:
Matthew Woehlke
2022-09-13 10:07:56 -04:00
committed by Brad King
parent 83686df1d6
commit 2edf0fc6d7
40 changed files with 81 additions and 80 deletions

View File

@@ -135,8 +135,7 @@ macro(_threads_check_flag_pthread)
configure_file(${CMAKE_CURRENT_LIST_DIR}/CheckForPthreads.c "${_threads_src}" COPYONLY)
endif()
try_compile(THREADS_HAVE_PTHREAD_ARG
${CMAKE_BINARY_DIR}
${_threads_src}
SOURCES ${_threads_src}
CMAKE_FLAGS -DLINK_LIBRARIES:STRING=-pthread
OUTPUT_VARIABLE _cmake_check_pthreads_output)