Commit fff9434d authored by Rolf Eike Beer's avatar Rolf Eike Beer Committed by Brad King

FindThreads: officially announce it works with only C++ enabled

parent 66db914a
Threads-CXX
------------
* The :module:`CheckFunctionExists`, :module:`CheckLibraryExists`, and
:module:`CheckSymbolExists` modules learned to work in environments where
only CXX is enabled.
* The :module:`CheckFunctionExists`, :module:`CheckLibraryExists`,
:module:`CheckSymbolExists`, and :module:`FindThreads` modules learned to
work in environments where only CXX is enabled.
add_test(NAME FindThreads.C-only COMMAND ${CMAKE_CTEST_COMMAND}
--build-and-test
"${CMake_SOURCE_DIR}/Tests/FindThreads/C-only"
"${CMake_BINARY_DIR}/Tests/FindThreads/C-only"
${build_generator_args}
--build-project FindThreads_C-only
--build-options ${build_options}
--test-command ${CMAKE_CTEST_COMMAND} -V
)
foreach (_lang IN ITEMS C CXX)
add_test(NAME FindThreads.${_lang}-only COMMAND ${CMAKE_CTEST_COMMAND}
--build-and-test
"${CMake_SOURCE_DIR}/Tests/FindThreads/${_lang}-only"
"${CMake_BINARY_DIR}/Tests/FindThreads/${_lang}-only"
${build_generator_args}
--build-project FindThreads_${_lang}-only
--build-options ${build_options}
--test-command ${CMAKE_CTEST_COMMAND} -V
)
endforeach ()
cmake_minimum_required(VERSION 3.3 FATAL_ERROR)
project(FindThreads_CXX-only CXX)
set(CMAKE_THREAD_PREFER_PTHREAD On)
find_package(Threads REQUIRED)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/../../../Modules/CheckForPthreads.c
${CMAKE_CURRENT_BINARY_DIR}/CheckForPthreads.cxx)
if (NOT WIN32)
add_executable(thr ${CMAKE_CURRENT_BINARY_DIR}/CheckForPthreads.cxx)
target_link_libraries(thr Threads::Threads)
endif ()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment