Skip to content
Snippets Groups Projects
Commit f789fcdd authored by Roger Leigh's avatar Roger Leigh
Browse files

cmake: Allow thread checks to fail and fall back to nothreads

Closes: #2155


git-svn-id: https://svn.apache.org/repos/asf/xerces/c/trunk@1843653 13f79535-47bb-0310-9956-ffa450edef68
parent 61e0c84f
No related branches found
No related tags found
No related merge requests found
......@@ -19,11 +19,15 @@
# mutexmgr selection
option(threads "Threading support" ON)
set(xerces_thread_default ON)
find_package(Threads)
if(NOT TARGET Threads::Threads)
set(xerces_thread_default ON)
endif()
include(CheckCXXSourceCompiles)
option(threads "Threading support" ${xerces_thread_default})
find_package(Threads REQUIRED)
include(CheckCXXSourceCompiles)
function(thread_test outvar)
set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment