We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3bb3448 commit d37c9a2Copy full SHA for d37c9a2
cmake/module/AddThreadsIfNeeded.cmake
@@ -7,8 +7,17 @@ function(add_threads_if_needed)
7
# require Threads. Therefore, a proper check will be
8
# appropriate here.
9
10
+ if(CMAKE_C_COMPILER_LOADED)
11
+ message(FATAL_ERROR [=[
12
+ To make FindThreads check C++ language features, C language must be
13
+ disabled. This is essential, at least, when cross-compiling for MinGW-w64
14
+ because two different threading models are available.
15
+ ]=] )
16
+ endif()
17
+
18
set(THREADS_PREFER_PTHREAD_FLAG ON)
19
find_package(Threads REQUIRED)
20
+ set_target_properties(Threads::Threads PROPERTIES IMPORTED_GLOBAL TRUE)
21
22
set(thread_local)
23
if(MINGW)
0 commit comments