@@ -39,13 +39,12 @@ option (WITH_GFLAGS "Use gflags" ON)
39
39
option (WITH_GTEST "Use Google Test" ON )
40
40
option (WITH_PKGCONFIG "Enable pkg-config support" OFF )
41
41
option (WITH_SYMBOLIZE "Enable symbolize module" ON )
42
- option (WITH_THREADS "Enable multithreading support" ON )
42
+ option (WITH_TLS "Enable Thread Local Storage (TLS) support" ON )
43
43
44
44
set (WITH_UNWIND libunwind CACHE STRING "unwind driver" )
45
45
set_property (CACHE WITH_UNWIND PROPERTY STRINGS none unwind libunwind)
46
46
47
47
cmake_dependent_option (WITH_GMOCK "Use Google Mock" ON WITH_GTEST OFF )
48
- cmake_dependent_option (WITH_TLS "Enable Thread Local Storage (TLS) support" ON WITH_THREADS OFF )
49
48
50
49
set (WITH_FUZZING none CACHE STRING "Fuzzing engine" )
51
50
set_property (CACHE WITH_FUZZING PROPERTY STRINGS none libfuzzer ossfuzz)
@@ -58,10 +57,6 @@ if (NOT WITH_GTEST)
58
57
set (CMAKE_DISABLE_FIND_PACKAGE_GTest ON )
59
58
endif (NOT WITH_GTEST)
60
59
61
- if (NOT WITH_THREADS)
62
- set (CMAKE_DISABLE_FIND_PACKAGE_Threads ON )
63
- endif (NOT WITH_THREADS)
64
-
65
60
set (CMAKE_C_VISIBILITY_PRESET hidden)
66
61
set (CMAKE_CXX_VISIBILITY_PRESET hidden)
67
62
set (CMAKE_POSITION_INDEPENDENT_CODE ON )
@@ -88,7 +83,7 @@ if (WITH_GFLAGS)
88
83
endif (gflags_FOUND)
89
84
endif (WITH_GFLAGS)
90
85
91
- find_package (Threads)
86
+ find_package (Threads REQUIRED )
92
87
find_package (Unwind)
93
88
94
89
if (Unwind_FOUND)
@@ -288,14 +283,6 @@ check_cxx_symbol_exists (localtime_r "cstdlib;ctime" HAVE_LOCALTIME_R)
288
283
289
284
set (SIZEOF_VOID_P ${CMAKE_SIZEOF_VOID_P} )
290
285
291
- if (WITH_THREADS AND Threads_FOUND)
292
- if (CMAKE_USE_PTHREADS_INIT)
293
- set (HAVE_PTHREAD 1)
294
- endif (CMAKE_USE_PTHREADS_INIT)
295
- else (WITH_THREADS AND Threads_FOUND)
296
- set (NO_THREADS 1)
297
- endif (WITH_THREADS AND Threads_FOUND)
298
-
299
286
# fopen/open on Cygwin can not handle unix-type paths like /home/....
300
287
# therefore we translate TEST_SRC_DIR to windows-path.
301
288
if (CYGWIN )
@@ -434,15 +421,11 @@ if (HAVE_DBGHELP)
434
421
set (glog_libraries_options_for_static_linking "${glog_libraries_options_for_static_linking} -ldbghelp" )
435
422
endif (HAVE_DBGHELP)
436
423
437
- if (HAVE_PTHREAD)
438
- target_link_libraries (glog PRIVATE Threads::Threads)
439
-
440
- set (Threads_DEPENDENCY "find_dependency (Threads)" )
424
+ target_link_libraries (glog PRIVATE Threads::Threads)
441
425
442
- if (CMAKE_THREAD_LIBS_INIT)
443
- set (glog_libraries_options_for_static_linking "${glog_libraries_options_for_static_linking} ${CMAKE_THREAD_LIBS_INIT} " )
444
- endif (CMAKE_THREAD_LIBS_INIT)
445
- endif (HAVE_PTHREAD)
426
+ if (CMAKE_THREAD_LIBS_INIT)
427
+ set (glog_libraries_options_for_static_linking "${glog_libraries_options_for_static_linking} ${CMAKE_THREAD_LIBS_INIT} " )
428
+ endif (CMAKE_THREAD_LIBS_INIT)
446
429
447
430
if (gflags_FOUND)
448
431
# Prefer the gflags target that uses double colon convention
0 commit comments