aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/patches/pthreadpool-system-libraries.patch
blob: 3cfe9c1af6dd8d496ff2fa0e9861c5b067c42508 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
This patch allows the build process to use the provided dependencies instead
of adding their source as CMake sub-directories (in which case "make install"
would install googletest's and googlebenchmark's libraries and headers).

diff --git a/CMakeLists.txt b/CMakeLists.txt
index c1cba55..627550f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -36,7 +36,7 @@ MACRO(PTHREADPOOL_TARGET_ENABLE_CXX11 target)
 ENDMACRO()
 
 # ---[ Download deps
-IF(NOT DEFINED FXDIV_SOURCE_DIR)
+IF(FALSE)
   MESSAGE(STATUS "Downloading FXdiv to ${CMAKE_BINARY_DIR}/FXdiv-source (define FXDIV_SOURCE_DIR to avoid it)")
   CONFIGURE_FILE(cmake/DownloadFXdiv.cmake "${CMAKE_BINARY_DIR}/FXdiv-download/CMakeLists.txt")
   EXECUTE_PROCESS(COMMAND "${CMAKE_COMMAND}" -G "${CMAKE_GENERATOR}" .
@@ -46,7 +46,7 @@ IF(NOT DEFINED FXDIV_SOURCE_DIR)
   SET(FXDIV_SOURCE_DIR "${CMAKE_BINARY_DIR}/FXdiv-source" CACHE STRING "FXdiv source directory")
 ENDIF()
 
-IF(PTHREADPOOL_BUILD_TESTS AND NOT DEFINED GOOGLETEST_SOURCE_DIR)
+IF(FALSE)
   MESSAGE(STATUS "Downloading Google Test to ${CMAKE_BINARY_DIR}/googletest-source (define GOOGLETEST_SOURCE_DIR to avoid it)")
   CONFIGURE_FILE(cmake/DownloadGoogleTest.cmake "${CMAKE_BINARY_DIR}/googletest-download/CMakeLists.txt")
   EXECUTE_PROCESS(COMMAND "${CMAKE_COMMAND}" -G "${CMAKE_GENERATOR}" .
@@ -56,7 +56,7 @@ IF(PTHREADPOOL_BUILD_TESTS AND NOT DEFINED GOOGLETEST_SOURCE_DIR)
   SET(GOOGLETEST_SOURCE_DIR "${CMAKE_BINARY_DIR}/googletest-source" CACHE STRING "Google Test source directory")
 ENDIF()
 
-IF(PTHREADPOOL_BUILD_BENCHMARKS AND NOT DEFINED GOOGLEBENCHMARK_SOURCE_DIR)
+IF(FALSE)
   MESSAGE(STATUS "Downloading Google Benchmark to ${CMAKE_BINARY_DIR}/googlebenchmark-source (define GOOGLEBENCHMARK_SOURCE_DIR to avoid it)")
   CONFIGURE_FILE(cmake/DownloadGoogleBenchmark.cmake "${CMAKE_BINARY_DIR}/googlebenchmark-download/CMakeLists.txt")
   EXECUTE_PROCESS(COMMAND "${CMAKE_COMMAND}" -G "${CMAKE_GENERATOR}" .
@@ -150,27 +150,18 @@ IF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
 ENDIF()
 
 # ---[ Configure FXdiv
-IF(NOT TARGET fxdiv)
+IF(FALSE)
   SET(FXDIV_BUILD_TESTS OFF CACHE BOOL "")
   SET(FXDIV_BUILD_BENCHMARKS OFF CACHE BOOL "")
   ADD_SUBDIRECTORY(
     "${FXDIV_SOURCE_DIR}"
     "${CMAKE_BINARY_DIR}/FXdiv")
 ENDIF()
-TARGET_LINK_LIBRARIES(pthreadpool PRIVATE fxdiv)
-
 INSTALL(TARGETS pthreadpool
   LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
   ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
 
 IF(PTHREADPOOL_BUILD_TESTS)
-  # ---[ Build google test
-  IF(NOT TARGET gtest)
-    SET(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
-    ADD_SUBDIRECTORY(
-      "${GOOGLETEST_SOURCE_DIR}"
-      "${CMAKE_BINARY_DIR}/googletest")
-  ENDIF()
 
   ADD_EXECUTABLE(pthreadpool-test test/pthreadpool.cc)
   SET_TARGET_PROPERTIES(pthreadpool-test PROPERTIES
@@ -188,14 +179,6 @@ IF(PTHREADPOOL_BUILD_TESTS)
 ENDIF()
 
 IF(PTHREADPOOL_BUILD_BENCHMARKS)
-  # ---[ Build google benchmark
-  IF(NOT TARGET benchmark)
-    SET(BENCHMARK_ENABLE_TESTING OFF CACHE BOOL "")
-    ADD_SUBDIRECTORY(
-      "${GOOGLEBENCHMARK_SOURCE_DIR}"
-      "${CMAKE_BINARY_DIR}/googlebenchmark")
-  ENDIF()
-
   ADD_EXECUTABLE(latency-bench bench/latency.cc)
   SET_TARGET_PROPERTIES(latency-bench PROPERTIES
     CXX_STANDARD 11