BUILD.gn (6489B)
1 # Copyright 2018 The Chromium Authors 2 # Use of this source code is governed by a BSD-style license that can be 3 # found in the LICENSE file. 4 5 import("//third_party/abseil-cpp/absl.gni") 6 7 absl_source_set("graphcycles_internal") { 8 sources = [ "internal/graphcycles.cc" ] 9 public = [ "internal/graphcycles.h" ] 10 deps = [ 11 "//third_party/abseil-cpp/absl/base", 12 "//third_party/abseil-cpp/absl/base:base_internal", 13 "//third_party/abseil-cpp/absl/base:config", 14 "//third_party/abseil-cpp/absl/base:core_headers", 15 "//third_party/abseil-cpp/absl/base:malloc_internal", 16 "//third_party/abseil-cpp/absl/base:raw_logging_internal", 17 ] 18 visibility = [ ":*" ] 19 } 20 21 absl_source_set("kernel_timeout_internal") { 22 sources = [ "internal/kernel_timeout.cc" ] 23 public = [ "internal/kernel_timeout.h" ] 24 deps = [ 25 "//third_party/abseil-cpp/absl/base", 26 "//third_party/abseil-cpp/absl/base:config", 27 "//third_party/abseil-cpp/absl/base:core_headers", 28 "//third_party/abseil-cpp/absl/base:raw_logging_internal", 29 "//third_party/abseil-cpp/absl/time", 30 ] 31 visibility = [ ":*" ] 32 } 33 34 absl_test("kernel_timeout_internal_test") { 35 sources = [ "internal/kernel_timeout_test.cc" ] 36 deps = [ 37 ":kernel_timeout_internal", 38 "//third_party/abseil-cpp/absl/base:config", 39 "//third_party/abseil-cpp/absl/random", 40 "//third_party/abseil-cpp/absl/time", 41 ] 42 } 43 44 absl_source_set("synchronization") { 45 sources = [ 46 "barrier.cc", 47 "blocking_counter.cc", 48 "internal/create_thread_identity.cc", 49 "internal/futex_waiter.cc", 50 "internal/per_thread_sem.cc", 51 "internal/pthread_waiter.cc", 52 "internal/sem_waiter.cc", 53 "internal/stdcpp_waiter.cc", 54 "internal/waiter_base.cc", 55 "internal/win32_waiter.cc", 56 "mutex.cc", 57 "notification.cc", 58 ] 59 public = [ 60 "barrier.h", 61 "blocking_counter.h", 62 "internal/create_thread_identity.h", 63 "internal/futex.h", 64 "internal/futex_waiter.h", 65 "internal/per_thread_sem.h", 66 "internal/pthread_waiter.h", 67 "internal/sem_waiter.h", 68 "internal/stdcpp_waiter.h", 69 "internal/waiter.h", 70 "internal/waiter_base.h", 71 "internal/win32_waiter.h", 72 "mutex.h", 73 "notification.h", 74 ] 75 deps = [ 76 ":graphcycles_internal", 77 ":kernel_timeout_internal", 78 "//third_party/abseil-cpp/absl/base", 79 "//third_party/abseil-cpp/absl/base:atomic_hook", 80 "//third_party/abseil-cpp/absl/base:base_internal", 81 "//third_party/abseil-cpp/absl/base:config", 82 "//third_party/abseil-cpp/absl/base:core_headers", 83 "//third_party/abseil-cpp/absl/base:dynamic_annotations", 84 "//third_party/abseil-cpp/absl/base:malloc_internal", 85 "//third_party/abseil-cpp/absl/base:nullability", 86 "//third_party/abseil-cpp/absl/base:raw_logging_internal", 87 "//third_party/abseil-cpp/absl/base:tracing_internal", 88 "//third_party/abseil-cpp/absl/debugging:stacktrace", 89 "//third_party/abseil-cpp/absl/debugging:symbolize", 90 "//third_party/abseil-cpp/absl/time", 91 ] 92 } 93 94 absl_test("barrier_test") { 95 sources = [ "barrier_test.cc" ] 96 deps = [ 97 ":synchronization", 98 "//third_party/abseil-cpp/absl/time", 99 ] 100 } 101 102 # Conflicts at link time with "tracing_strong_test" because also defines 103 # strong functions for AbslInternalTraceWait and alike 104 # absl_test("blocking_counter_test") { 105 # sources = [ "blocking_counter_test.cc" ] 106 # deps = [ 107 # ":synchronization", 108 # "//third_party/abseil-cpp/absl/base:config", 109 # "//third_party/abseil-cpp/absl/base:core_headers", 110 # "//third_party/abseil-cpp/absl/base:tracing_internal", 111 # "//third_party/abseil-cpp/absl/time", 112 # ] 113 # } 114 115 absl_test("graphcycles_test") { 116 sources = [ "internal/graphcycles_test.cc" ] 117 deps = [ 118 ":graphcycles_internal", 119 "//third_party/abseil-cpp/absl/base:core_headers", 120 "//third_party/abseil-cpp/absl/log", 121 "//third_party/abseil-cpp/absl/log:check", 122 ] 123 } 124 125 absl_source_set("thread_pool") { 126 testonly = true 127 public = [ "internal/thread_pool.h" ] 128 deps = [ 129 ":synchronization", 130 "//third_party/abseil-cpp/absl/base:core_headers", 131 "//third_party/abseil-cpp/absl/functional:any_invocable", 132 ] 133 visibility = [ "//third_party/abseil-cpp/absl/*" ] 134 } 135 136 absl_test("mutex_test") { 137 sources = [ "mutex_test.cc" ] 138 deps = [ 139 ":synchronization", 140 ":thread_pool", 141 "//third_party/abseil-cpp/absl/base", 142 "//third_party/abseil-cpp/absl/base:config", 143 "//third_party/abseil-cpp/absl/base:core_headers", 144 "//third_party/abseil-cpp/absl/log", 145 "//third_party/abseil-cpp/absl/log:check", 146 "//third_party/abseil-cpp/absl/memory", 147 "//third_party/abseil-cpp/absl/time", 148 ] 149 } 150 151 # Doesn't compile. 152 # absl_test("mutex_method_pointer_test") { 153 # sources = [ "mutex_method_pointer_test.cc" ] 154 # deps = [ 155 # ":synchronization", 156 # "//third_party/abseil-cpp/absl/base:config", 157 # ] 158 # } 159 160 # Conflicts at link time with "tracing_strong_test" because also defines 161 # strong functions for AbslInternalTraceWait and alike 162 # absl_test("notification_test") { 163 # sources = [ "notification_test.cc" ] 164 # deps = [ 165 # ":synchronization", 166 # "//third_party/abseil-cpp/absl/base:config", 167 # "//third_party/abseil-cpp/absl/base:core_headers", 168 # "//third_party/abseil-cpp/absl/base:tracing_internal", 169 # "//third_party/abseil-cpp/absl/time", 170 # ] 171 # } 172 173 absl_source_set("per_thread_sem_test_common") { 174 testonly = true 175 sources = [ "internal/per_thread_sem_test.cc" ] 176 deps = [ 177 ":synchronization", 178 "//third_party/abseil-cpp/absl/base", 179 "//third_party/abseil-cpp/absl/base:config", 180 "//third_party/abseil-cpp/absl/strings", 181 "//third_party/abseil-cpp/absl/time", 182 "//third_party/googletest:gtest", 183 ] 184 visibility = [ ":*" ] 185 } 186 187 absl_test("per_thread_sem_test") { 188 deps = [ 189 ":per_thread_sem_test_common", 190 ":synchronization", 191 "//third_party/abseil-cpp/absl/strings", 192 "//third_party/abseil-cpp/absl/time", 193 ] 194 } 195 196 absl_test("waiter_test") { 197 sources = [ "internal/waiter_test.cc" ] 198 deps = [ 199 ":kernel_timeout_internal", 200 ":synchronization", 201 ":thread_pool", 202 "//third_party/abseil-cpp/absl/base:config", 203 "//third_party/abseil-cpp/absl/random", 204 "//third_party/abseil-cpp/absl/time", 205 ] 206 } 207 # Has it's own main function and thus can't be included into absl_tests target 208 # absl_test("lifetime_test") { 209 # sources = [ "lifetime_test.cc" ] 210 # deps = [ 211 # ":synchronization", 212 # "//third_party/abseil-cpp/absl/base:core_headers", 213 # "//third_party/abseil-cpp/absl/log:check", 214 # ] 215 # }