FindThreads: officially announce it works with only C++ enabled
This commit is contained in:
parent
66db914adf
commit
fff9434d45
|
@ -1,6 +1,6 @@
|
||||||
Threads-CXX
|
Threads-CXX
|
||||||
------------
|
------------
|
||||||
|
|
||||||
* The :module:`CheckFunctionExists`, :module:`CheckLibraryExists`, and
|
* The :module:`CheckFunctionExists`, :module:`CheckLibraryExists`,
|
||||||
:module:`CheckSymbolExists` modules learned to work in environments where
|
:module:`CheckSymbolExists`, and :module:`FindThreads` modules learned to
|
||||||
only CXX is enabled.
|
work in environments where only CXX is enabled.
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
add_test(NAME FindThreads.C-only COMMAND ${CMAKE_CTEST_COMMAND}
|
foreach (_lang IN ITEMS C CXX)
|
||||||
--build-and-test
|
add_test(NAME FindThreads.${_lang}-only COMMAND ${CMAKE_CTEST_COMMAND}
|
||||||
"${CMake_SOURCE_DIR}/Tests/FindThreads/C-only"
|
--build-and-test
|
||||||
"${CMake_BINARY_DIR}/Tests/FindThreads/C-only"
|
"${CMake_SOURCE_DIR}/Tests/FindThreads/${_lang}-only"
|
||||||
${build_generator_args}
|
"${CMake_BINARY_DIR}/Tests/FindThreads/${_lang}-only"
|
||||||
--build-project FindThreads_C-only
|
${build_generator_args}
|
||||||
--build-options ${build_options}
|
--build-project FindThreads_${_lang}-only
|
||||||
--test-command ${CMAKE_CTEST_COMMAND} -V
|
--build-options ${build_options}
|
||||||
)
|
--test-command ${CMAKE_CTEST_COMMAND} -V
|
||||||
|
)
|
||||||
|
endforeach ()
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
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 ()
|
Loading…
Reference in New Issue