Author: rleigh
Date: Fri Oct 12 12:02:58 2018
New Revision: 1843653
URL: http://svn.apache.org/viewvc?rev=1843653&view=rev
Log:
cmake: Allow thread checks to fail and fall back to nothreads
Closes: #2155
Modified:
xerces/c/trunk/cmake/XercesMutexMgrSelection.cmake
Modified: xerces/c/trunk/cmake/XercesMutexMgrSelection.cmake
URL:
http://svn.apache.org/viewvc/xerces/c/trunk/cmake/XercesMutexMgrSelection.cmake?rev=1843653&r1=1843652&r2=1843653&view=diff
==============================================================================
--- xerces/c/trunk/cmake/XercesMutexMgrSelection.cmake (original)
+++ xerces/c/trunk/cmake/XercesMutexMgrSelection.cmake Fri Oct 12 12:02:58 2018
@@ -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})
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]