FindThreads: officially announce it works with only C++ enabled
This commit is contained in:
parent
66db914adf
commit
fff9434d45
|
@ -1,6 +1,6 @@
|
|||
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.
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
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 ()
|
||||
|
|
|
@ -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