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 5import("//third_party/abseil-cpp/absl.gni") 6 7absl_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 21absl_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 34absl_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 44absl_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:raw_logging_internal", 86 "//third_party/abseil-cpp/absl/base:tracing_internal", 87 "//third_party/abseil-cpp/absl/debugging:stacktrace", 88 "//third_party/abseil-cpp/absl/debugging:symbolize", 89 "//third_party/abseil-cpp/absl/time", 90 ] 91} 92 93absl_test("barrier_test") { 94 sources = [ "barrier_test.cc" ] 95 deps = [ 96 ":synchronization", 97 "//third_party/abseil-cpp/absl/time", 98 ] 99} 100 101# Conflicts at link time with "tracing_strong_test" because also defines 102# strong functions for AbslInternalTraceWait and alike 103# absl_test("blocking_counter_test") { 104# sources = [ "blocking_counter_test.cc" ] 105# deps = [ 106# ":synchronization", 107# "//third_party/abseil-cpp/absl/base:config", 108# "//third_party/abseil-cpp/absl/base:core_headers", 109# "//third_party/abseil-cpp/absl/base:tracing_internal", 110# "//third_party/abseil-cpp/absl/time", 111# ] 112# } 113 114absl_test("graphcycles_test") { 115 sources = [ "internal/graphcycles_test.cc" ] 116 deps = [ 117 ":graphcycles_internal", 118 "//third_party/abseil-cpp/absl/base:core_headers", 119 "//third_party/abseil-cpp/absl/log", 120 "//third_party/abseil-cpp/absl/log:check", 121 ] 122} 123 124absl_source_set("thread_pool") { 125 testonly = true 126 public = [ "internal/thread_pool.h" ] 127 deps = [ 128 ":synchronization", 129 "//third_party/abseil-cpp/absl/base:core_headers", 130 "//third_party/abseil-cpp/absl/functional:any_invocable", 131 ] 132 visibility = [ "//third_party/abseil-cpp/absl/*" ] 133} 134 135absl_test("mutex_test") { 136 sources = [ "mutex_test.cc" ] 137 deps = [ 138 ":synchronization", 139 ":thread_pool", 140 "//third_party/abseil-cpp/absl/base", 141 "//third_party/abseil-cpp/absl/base:config", 142 "//third_party/abseil-cpp/absl/base:core_headers", 143 "//third_party/abseil-cpp/absl/log", 144 "//third_party/abseil-cpp/absl/log:check", 145 "//third_party/abseil-cpp/absl/memory", 146 "//third_party/abseil-cpp/absl/time", 147 ] 148} 149 150# Doesn't compile. 151# absl_test("mutex_method_pointer_test") { 152# sources = [ "mutex_method_pointer_test.cc" ] 153# deps = [ 154# ":synchronization", 155# "//third_party/abseil-cpp/absl/base:config", 156# ] 157# } 158 159# Conflicts at link time with "tracing_strong_test" because also defines 160# strong functions for AbslInternalTraceWait and alike 161# absl_test("notification_test") { 162# sources = [ "notification_test.cc" ] 163# deps = [ 164# ":synchronization", 165# "//third_party/abseil-cpp/absl/base:config", 166# "//third_party/abseil-cpp/absl/base:core_headers", 167# "//third_party/abseil-cpp/absl/base:tracing_internal", 168# "//third_party/abseil-cpp/absl/time", 169# ] 170# } 171 172absl_source_set("per_thread_sem_test_common") { 173 testonly = true 174 sources = [ "internal/per_thread_sem_test.cc" ] 175 deps = [ 176 ":synchronization", 177 "//third_party/abseil-cpp/absl/base", 178 "//third_party/abseil-cpp/absl/base:config", 179 "//third_party/abseil-cpp/absl/strings", 180 "//third_party/abseil-cpp/absl/time", 181 "//third_party/googletest:gtest", 182 ] 183 visibility = [ ":*" ] 184} 185 186absl_test("per_thread_sem_test") { 187 deps = [ 188 ":per_thread_sem_test_common", 189 ":synchronization", 190 "//third_party/abseil-cpp/absl/strings", 191 "//third_party/abseil-cpp/absl/time", 192 ] 193} 194 195absl_test("waiter_test") { 196 sources = [ "internal/waiter_test.cc" ] 197 deps = [ 198 ":kernel_timeout_internal", 199 ":synchronization", 200 ":thread_pool", 201 "//third_party/abseil-cpp/absl/base:config", 202 "//third_party/abseil-cpp/absl/random", 203 "//third_party/abseil-cpp/absl/time", 204 ] 205} 206# Has it's own main function and thus can't be included into absl_tests target 207# absl_test("lifetime_test") { 208# sources = [ "lifetime_test.cc" ] 209# deps = [ 210# ":synchronization", 211# "//third_party/abseil-cpp/absl/base:core_headers", 212# "//third_party/abseil-cpp/absl/log:check", 213# ] 214# } 215