File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,20 @@ project(boost_thread VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX)
1010set (THREADS_PREFER_PTHREAD_FLAG ON )
1111find_package (Threads REQUIRED)
1212
13- if (WIN32 )
13+ set (_default_threadapi pthread)
14+
15+ if (WIN32 AND NOT CMAKE_CXX_PLATFORM_ID MATCHES "Cygwin" )
16+ set (_default_threadapi win32 )
17+ endif ()
18+
19+ set (BOOST_THREAD_THREADAPI ${_default_threadapi} CACHE STRING "Boost.Thread threading API (pthread or win32)" )
20+ set_property (CACHE BOOST_THREAD_THREADAPI PROPERTY STRINGS pthread win32 )
21+
22+ unset (_default_threadapi)
23+
24+ message (STATUS "Boost.Thread: threading API is ${BOOST_THREAD_THREADAPI} " )
25+
26+ if (BOOST_THREAD_THREADAPI STREQUAL win32 )
1427
1528 set (THREAD_SOURCES
1629 src/win32 /thread.cpp
You can’t perform that action at this time.
0 commit comments