BUILD.bazel 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883
  1. #
  2. # Copyright 2017 The Abseil Authors.
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License");
  5. # you may not use this file except in compliance with the License.
  6. # You may obtain a copy of the License at
  7. #
  8. # https://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. #
  16. load(
  17. "//absl:copts/configure_copts.bzl",
  18. "ABSL_DEFAULT_COPTS",
  19. "ABSL_DEFAULT_LINKOPTS",
  20. "ABSL_TEST_COPTS",
  21. )
  22. package(
  23. default_visibility = ["//visibility:public"],
  24. features = [
  25. "header_modules",
  26. "layering_check",
  27. "parse_headers",
  28. ],
  29. )
  30. licenses(["notice"])
  31. cc_library(
  32. name = "atomic_hook",
  33. hdrs = ["internal/atomic_hook.h"],
  34. copts = ABSL_DEFAULT_COPTS,
  35. linkopts = ABSL_DEFAULT_LINKOPTS,
  36. visibility = [
  37. "//absl:__subpackages__",
  38. ],
  39. deps = [
  40. ":config",
  41. ":core_headers",
  42. ],
  43. )
  44. cc_library(
  45. name = "errno_saver",
  46. hdrs = ["internal/errno_saver.h"],
  47. copts = ABSL_DEFAULT_COPTS,
  48. linkopts = ABSL_DEFAULT_LINKOPTS,
  49. visibility = [
  50. "//absl:__subpackages__",
  51. ],
  52. deps = [":config"],
  53. )
  54. cc_library(
  55. name = "log_severity",
  56. srcs = ["log_severity.cc"],
  57. hdrs = ["log_severity.h"],
  58. copts = ABSL_DEFAULT_COPTS,
  59. linkopts = ABSL_DEFAULT_LINKOPTS,
  60. deps = [
  61. ":config",
  62. ":core_headers",
  63. ],
  64. )
  65. cc_library(
  66. name = "no_destructor",
  67. hdrs = ["no_destructor.h"],
  68. copts = ABSL_DEFAULT_COPTS,
  69. linkopts = ABSL_DEFAULT_LINKOPTS,
  70. deps = [
  71. ":config",
  72. ":nullability",
  73. ],
  74. )
  75. cc_library(
  76. name = "nullability",
  77. srcs = ["internal/nullability_impl.h"],
  78. hdrs = ["nullability.h"],
  79. copts = ABSL_DEFAULT_COPTS,
  80. linkopts = ABSL_DEFAULT_LINKOPTS,
  81. deps = [
  82. ":core_headers",
  83. "//absl/meta:type_traits",
  84. ],
  85. )
  86. cc_library(
  87. name = "raw_logging_internal",
  88. srcs = ["internal/raw_logging.cc"],
  89. hdrs = ["internal/raw_logging.h"],
  90. copts = ABSL_DEFAULT_COPTS,
  91. linkopts = ABSL_DEFAULT_LINKOPTS,
  92. visibility = [
  93. "//absl:__subpackages__",
  94. ],
  95. deps = [
  96. ":atomic_hook",
  97. ":config",
  98. ":core_headers",
  99. ":errno_saver",
  100. ":log_severity",
  101. ],
  102. )
  103. cc_library(
  104. name = "spinlock_wait",
  105. srcs = [
  106. "internal/spinlock_akaros.inc",
  107. "internal/spinlock_linux.inc",
  108. "internal/spinlock_posix.inc",
  109. "internal/spinlock_wait.cc",
  110. "internal/spinlock_win32.inc",
  111. ],
  112. hdrs = ["internal/spinlock_wait.h"],
  113. copts = ABSL_DEFAULT_COPTS,
  114. linkopts = ABSL_DEFAULT_LINKOPTS,
  115. visibility = [
  116. "//absl/base:__pkg__",
  117. ],
  118. deps = [
  119. ":base_internal",
  120. ":core_headers",
  121. ":errno_saver",
  122. ],
  123. )
  124. cc_library(
  125. name = "config",
  126. hdrs = [
  127. "config.h",
  128. "options.h",
  129. "policy_checks.h",
  130. ],
  131. copts = ABSL_DEFAULT_COPTS,
  132. linkopts = ABSL_DEFAULT_LINKOPTS,
  133. )
  134. cc_library(
  135. name = "cycleclock_internal",
  136. hdrs = [
  137. "internal/cycleclock_config.h",
  138. "internal/unscaledcycleclock_config.h",
  139. ],
  140. copts = ABSL_DEFAULT_COPTS,
  141. linkopts = ABSL_DEFAULT_LINKOPTS,
  142. visibility = [
  143. "//absl:__subpackages__",
  144. ],
  145. deps = [
  146. ":base_internal",
  147. ":config",
  148. ],
  149. )
  150. cc_library(
  151. name = "dynamic_annotations",
  152. srcs = [
  153. "internal/dynamic_annotations.h",
  154. ],
  155. hdrs = [
  156. "dynamic_annotations.h",
  157. ],
  158. copts = ABSL_DEFAULT_COPTS,
  159. linkopts = ABSL_DEFAULT_LINKOPTS,
  160. deps = [
  161. ":config",
  162. ":core_headers",
  163. ],
  164. )
  165. cc_library(
  166. name = "core_headers",
  167. hdrs = [
  168. "attributes.h",
  169. "const_init.h",
  170. "macros.h",
  171. "optimization.h",
  172. "port.h",
  173. "thread_annotations.h",
  174. ],
  175. copts = ABSL_DEFAULT_COPTS,
  176. linkopts = ABSL_DEFAULT_LINKOPTS,
  177. deps = [
  178. ":config",
  179. ],
  180. )
  181. cc_library(
  182. name = "malloc_internal",
  183. srcs = [
  184. "internal/low_level_alloc.cc",
  185. ],
  186. hdrs = [
  187. "internal/direct_mmap.h",
  188. "internal/low_level_alloc.h",
  189. ],
  190. copts = ABSL_DEFAULT_COPTS + select({
  191. "//conditions:default": [],
  192. }),
  193. linkopts = select({
  194. "//absl:msvc_compiler": [],
  195. "//absl:clang-cl_compiler": [],
  196. "//absl:wasm": [],
  197. "//conditions:default": ["-pthread"],
  198. }) + ABSL_DEFAULT_LINKOPTS,
  199. visibility = [
  200. "//visibility:public",
  201. ],
  202. deps = [
  203. ":base",
  204. ":base_internal",
  205. ":config",
  206. ":core_headers",
  207. ":dynamic_annotations",
  208. ":raw_logging_internal",
  209. ],
  210. )
  211. cc_library(
  212. name = "base_internal",
  213. hdrs = [
  214. "internal/hide_ptr.h",
  215. "internal/identity.h",
  216. "internal/inline_variable.h",
  217. "internal/invoke.h",
  218. "internal/scheduling_mode.h",
  219. ],
  220. copts = ABSL_DEFAULT_COPTS,
  221. linkopts = ABSL_DEFAULT_LINKOPTS,
  222. visibility = [
  223. "//absl:__subpackages__",
  224. ],
  225. deps = [
  226. ":config",
  227. "//absl/meta:type_traits",
  228. ],
  229. )
  230. cc_library(
  231. name = "base",
  232. srcs = [
  233. "internal/cycleclock.cc",
  234. "internal/spinlock.cc",
  235. "internal/sysinfo.cc",
  236. "internal/thread_identity.cc",
  237. "internal/unscaledcycleclock.cc",
  238. ],
  239. hdrs = [
  240. "call_once.h",
  241. "casts.h",
  242. "internal/cycleclock.h",
  243. "internal/low_level_scheduling.h",
  244. "internal/per_thread_tls.h",
  245. "internal/spinlock.h",
  246. "internal/sysinfo.h",
  247. "internal/thread_identity.h",
  248. "internal/tsan_mutex_interface.h",
  249. "internal/unscaledcycleclock.h",
  250. ],
  251. copts = ABSL_DEFAULT_COPTS,
  252. linkopts = select({
  253. "//absl:msvc_compiler": [
  254. "-DEFAULTLIB:advapi32.lib",
  255. ],
  256. "//absl:clang-cl_compiler": [
  257. "-DEFAULTLIB:advapi32.lib",
  258. ],
  259. "//absl:mingw_compiler": [
  260. "-DEFAULTLIB:advapi32.lib",
  261. "-ladvapi32",
  262. ],
  263. "//absl:wasm": [],
  264. "//conditions:default": ["-pthread"],
  265. }) + ABSL_DEFAULT_LINKOPTS,
  266. deps = [
  267. ":atomic_hook",
  268. ":base_internal",
  269. ":config",
  270. ":core_headers",
  271. ":cycleclock_internal",
  272. ":dynamic_annotations",
  273. ":log_severity",
  274. ":nullability",
  275. ":raw_logging_internal",
  276. ":spinlock_wait",
  277. "//absl/meta:type_traits",
  278. ],
  279. )
  280. cc_library(
  281. name = "atomic_hook_test_helper",
  282. testonly = True,
  283. srcs = ["internal/atomic_hook_test_helper.cc"],
  284. hdrs = ["internal/atomic_hook_test_helper.h"],
  285. copts = ABSL_DEFAULT_COPTS,
  286. linkopts = ABSL_DEFAULT_LINKOPTS,
  287. deps = [
  288. ":atomic_hook",
  289. ":core_headers",
  290. ],
  291. )
  292. cc_test(
  293. name = "atomic_hook_test",
  294. size = "small",
  295. srcs = ["internal/atomic_hook_test.cc"],
  296. copts = ABSL_TEST_COPTS,
  297. linkopts = ABSL_DEFAULT_LINKOPTS,
  298. deps = [
  299. ":atomic_hook",
  300. ":atomic_hook_test_helper",
  301. ":core_headers",
  302. "@com_google_googletest//:gtest",
  303. "@com_google_googletest//:gtest_main",
  304. ],
  305. )
  306. cc_test(
  307. name = "bit_cast_test",
  308. size = "small",
  309. srcs = [
  310. "bit_cast_test.cc",
  311. ],
  312. copts = ABSL_TEST_COPTS,
  313. linkopts = ABSL_DEFAULT_LINKOPTS,
  314. deps = [
  315. ":base",
  316. ":core_headers",
  317. "@com_google_googletest//:gtest",
  318. "@com_google_googletest//:gtest_main",
  319. ],
  320. )
  321. cc_library(
  322. name = "throw_delegate",
  323. srcs = ["internal/throw_delegate.cc"],
  324. hdrs = ["internal/throw_delegate.h"],
  325. copts = ABSL_DEFAULT_COPTS,
  326. linkopts = ABSL_DEFAULT_LINKOPTS,
  327. visibility = [
  328. "//absl:__subpackages__",
  329. ],
  330. deps = [
  331. ":config",
  332. ":raw_logging_internal",
  333. ],
  334. )
  335. cc_test(
  336. name = "throw_delegate_test",
  337. srcs = ["throw_delegate_test.cc"],
  338. copts = ABSL_TEST_COPTS,
  339. linkopts = ABSL_DEFAULT_LINKOPTS,
  340. deps = [
  341. ":config",
  342. ":throw_delegate",
  343. "@com_google_googletest//:gtest",
  344. "@com_google_googletest//:gtest_main",
  345. ],
  346. )
  347. cc_test(
  348. name = "errno_saver_test",
  349. size = "small",
  350. srcs = ["internal/errno_saver_test.cc"],
  351. copts = ABSL_TEST_COPTS,
  352. linkopts = ABSL_DEFAULT_LINKOPTS,
  353. deps = [
  354. ":errno_saver",
  355. ":strerror",
  356. "@com_google_googletest//:gtest",
  357. "@com_google_googletest//:gtest_main",
  358. ],
  359. )
  360. cc_library(
  361. name = "exception_testing",
  362. testonly = True,
  363. hdrs = ["internal/exception_testing.h"],
  364. copts = ABSL_TEST_COPTS,
  365. linkopts = ABSL_DEFAULT_LINKOPTS,
  366. visibility = [
  367. "//absl:__subpackages__",
  368. ],
  369. deps = [
  370. ":config",
  371. "@com_google_googletest//:gtest",
  372. ],
  373. )
  374. cc_library(
  375. name = "pretty_function",
  376. hdrs = ["internal/pretty_function.h"],
  377. linkopts = ABSL_DEFAULT_LINKOPTS,
  378. visibility = [
  379. "//absl:__subpackages__",
  380. ],
  381. )
  382. cc_library(
  383. name = "exception_safety_testing",
  384. testonly = True,
  385. srcs = ["internal/exception_safety_testing.cc"],
  386. hdrs = ["internal/exception_safety_testing.h"],
  387. copts = ABSL_TEST_COPTS,
  388. linkopts = ABSL_DEFAULT_LINKOPTS,
  389. deps = [
  390. ":config",
  391. ":pretty_function",
  392. "//absl/memory",
  393. "//absl/meta:type_traits",
  394. "//absl/strings",
  395. "//absl/utility",
  396. "@com_google_googletest//:gtest",
  397. ],
  398. )
  399. cc_test(
  400. name = "exception_safety_testing_test",
  401. srcs = ["exception_safety_testing_test.cc"],
  402. copts = ABSL_TEST_COPTS,
  403. linkopts = ABSL_DEFAULT_LINKOPTS,
  404. deps = [
  405. ":exception_safety_testing",
  406. "//absl/memory",
  407. "@com_google_googletest//:gtest",
  408. "@com_google_googletest//:gtest_main",
  409. ],
  410. )
  411. cc_test(
  412. name = "inline_variable_test",
  413. size = "small",
  414. srcs = [
  415. "inline_variable_test.cc",
  416. "inline_variable_test_a.cc",
  417. "inline_variable_test_b.cc",
  418. "internal/inline_variable_testing.h",
  419. ],
  420. copts = ABSL_TEST_COPTS,
  421. linkopts = ABSL_DEFAULT_LINKOPTS,
  422. deps = [
  423. ":base_internal",
  424. "@com_google_googletest//:gtest",
  425. "@com_google_googletest//:gtest_main",
  426. ],
  427. )
  428. cc_test(
  429. name = "invoke_test",
  430. size = "small",
  431. srcs = ["invoke_test.cc"],
  432. copts = ABSL_TEST_COPTS,
  433. linkopts = ABSL_DEFAULT_LINKOPTS,
  434. deps = [
  435. ":base_internal",
  436. "//absl/memory",
  437. "//absl/strings",
  438. "@com_google_googletest//:gtest",
  439. "@com_google_googletest//:gtest_main",
  440. ],
  441. )
  442. # Common test library made available for use in non-absl code that overrides
  443. # AbslInternalSpinLockDelay and AbslInternalSpinLockWake.
  444. cc_library(
  445. name = "spinlock_test_common",
  446. testonly = True,
  447. srcs = ["spinlock_test_common.cc"],
  448. copts = ABSL_TEST_COPTS,
  449. linkopts = ABSL_DEFAULT_LINKOPTS,
  450. deps = [
  451. ":base",
  452. ":base_internal",
  453. ":config",
  454. ":core_headers",
  455. "//absl/synchronization",
  456. "@com_google_googletest//:gtest",
  457. ],
  458. alwayslink = 1,
  459. )
  460. cc_test(
  461. name = "spinlock_test",
  462. size = "medium",
  463. srcs = ["spinlock_test_common.cc"],
  464. copts = ABSL_TEST_COPTS,
  465. linkopts = ABSL_DEFAULT_LINKOPTS,
  466. tags = [
  467. "no_test_wasm",
  468. ],
  469. deps = [
  470. ":base",
  471. ":base_internal",
  472. ":config",
  473. ":core_headers",
  474. "//absl/synchronization",
  475. "@com_google_googletest//:gtest",
  476. "@com_google_googletest//:gtest_main",
  477. ],
  478. )
  479. cc_library(
  480. name = "spinlock_benchmark_common",
  481. testonly = True,
  482. srcs = ["internal/spinlock_benchmark.cc"],
  483. copts = ABSL_TEST_COPTS,
  484. linkopts = ABSL_DEFAULT_LINKOPTS,
  485. visibility = [
  486. "//absl/base:__pkg__",
  487. ],
  488. deps = [
  489. ":base",
  490. ":base_internal",
  491. ":no_destructor",
  492. ":raw_logging_internal",
  493. "//absl/synchronization",
  494. "@com_github_google_benchmark//:benchmark_main",
  495. ],
  496. alwayslink = 1,
  497. )
  498. cc_binary(
  499. name = "spinlock_benchmark",
  500. testonly = True,
  501. copts = ABSL_DEFAULT_COPTS,
  502. linkopts = ABSL_DEFAULT_LINKOPTS,
  503. tags = ["benchmark"],
  504. visibility = ["//visibility:private"],
  505. deps = [
  506. ":spinlock_benchmark_common",
  507. ],
  508. )
  509. cc_library(
  510. name = "endian",
  511. hdrs = [
  512. "internal/endian.h",
  513. "internal/unaligned_access.h",
  514. ],
  515. copts = ABSL_DEFAULT_COPTS,
  516. linkopts = ABSL_DEFAULT_LINKOPTS,
  517. deps = [
  518. ":base",
  519. ":config",
  520. ":core_headers",
  521. ":nullability",
  522. ],
  523. )
  524. cc_test(
  525. name = "endian_test",
  526. srcs = ["internal/endian_test.cc"],
  527. copts = ABSL_TEST_COPTS,
  528. deps = [
  529. ":config",
  530. ":endian",
  531. "@com_google_googletest//:gtest",
  532. "@com_google_googletest//:gtest_main",
  533. ],
  534. )
  535. cc_test(
  536. name = "config_test",
  537. srcs = ["config_test.cc"],
  538. copts = ABSL_TEST_COPTS,
  539. linkopts = ABSL_DEFAULT_LINKOPTS,
  540. deps = [
  541. ":config",
  542. "//absl/synchronization:thread_pool",
  543. "@com_google_googletest//:gtest",
  544. "@com_google_googletest//:gtest_main",
  545. ],
  546. )
  547. cc_test(
  548. name = "call_once_test",
  549. srcs = ["call_once_test.cc"],
  550. copts = ABSL_TEST_COPTS,
  551. linkopts = ABSL_DEFAULT_LINKOPTS,
  552. deps = [
  553. ":base",
  554. ":core_headers",
  555. "//absl/synchronization",
  556. "@com_google_googletest//:gtest",
  557. "@com_google_googletest//:gtest_main",
  558. ],
  559. )
  560. cc_test(
  561. name = "no_destructor_test",
  562. srcs = ["no_destructor_test.cc"],
  563. copts = ABSL_TEST_COPTS,
  564. linkopts = ABSL_DEFAULT_LINKOPTS,
  565. deps = [
  566. ":config",
  567. ":no_destructor",
  568. ":raw_logging_internal",
  569. "@com_google_googletest//:gtest",
  570. "@com_google_googletest//:gtest_main",
  571. ],
  572. )
  573. cc_binary(
  574. name = "no_destructor_benchmark",
  575. testonly = True,
  576. srcs = ["no_destructor_benchmark.cc"],
  577. copts = ABSL_TEST_COPTS,
  578. linkopts = ABSL_DEFAULT_LINKOPTS,
  579. tags = ["benchmark"],
  580. visibility = ["//visibility:private"],
  581. deps = [
  582. ":no_destructor",
  583. ":raw_logging_internal",
  584. "@com_github_google_benchmark//:benchmark_main",
  585. ],
  586. )
  587. cc_test(
  588. name = "nullability_test",
  589. srcs = ["nullability_test.cc"],
  590. deps = [
  591. ":core_headers",
  592. ":nullability",
  593. "@com_google_googletest//:gtest",
  594. "@com_google_googletest//:gtest_main",
  595. ],
  596. )
  597. cc_test(
  598. name = "raw_logging_test",
  599. srcs = ["raw_logging_test.cc"],
  600. copts = ABSL_TEST_COPTS,
  601. linkopts = ABSL_DEFAULT_LINKOPTS,
  602. deps = [
  603. ":raw_logging_internal",
  604. "//absl/strings",
  605. "@com_google_googletest//:gtest",
  606. "@com_google_googletest//:gtest_main",
  607. ],
  608. )
  609. cc_test(
  610. name = "sysinfo_test",
  611. size = "small",
  612. srcs = ["internal/sysinfo_test.cc"],
  613. copts = ABSL_TEST_COPTS,
  614. linkopts = ABSL_DEFAULT_LINKOPTS,
  615. deps = [
  616. ":base",
  617. "//absl/synchronization",
  618. "@com_google_googletest//:gtest",
  619. "@com_google_googletest//:gtest_main",
  620. ],
  621. )
  622. cc_test(
  623. name = "low_level_alloc_test",
  624. size = "medium",
  625. srcs = ["internal/low_level_alloc_test.cc"],
  626. copts = ABSL_TEST_COPTS,
  627. linkopts = ABSL_DEFAULT_LINKOPTS,
  628. tags = [
  629. "no_test_ios_x86_64",
  630. "no_test_wasm",
  631. ],
  632. deps = [
  633. ":malloc_internal",
  634. "//absl/container:node_hash_map",
  635. ],
  636. )
  637. cc_test(
  638. name = "thread_identity_test",
  639. size = "small",
  640. srcs = ["internal/thread_identity_test.cc"],
  641. copts = ABSL_TEST_COPTS,
  642. linkopts = ABSL_DEFAULT_LINKOPTS,
  643. tags = [
  644. "no_test_wasm",
  645. ],
  646. deps = [
  647. ":base",
  648. ":core_headers",
  649. "//absl/synchronization",
  650. "@com_google_googletest//:gtest",
  651. "@com_google_googletest//:gtest_main",
  652. ],
  653. )
  654. cc_test(
  655. name = "thread_identity_benchmark",
  656. srcs = ["internal/thread_identity_benchmark.cc"],
  657. copts = ABSL_TEST_COPTS,
  658. linkopts = ABSL_DEFAULT_LINKOPTS,
  659. tags = ["benchmark"],
  660. visibility = ["//visibility:private"],
  661. deps = [
  662. ":base",
  663. "//absl/synchronization",
  664. "@com_github_google_benchmark//:benchmark_main",
  665. "@com_google_googletest//:gtest",
  666. ],
  667. )
  668. cc_library(
  669. name = "scoped_set_env",
  670. testonly = True,
  671. srcs = ["internal/scoped_set_env.cc"],
  672. hdrs = ["internal/scoped_set_env.h"],
  673. linkopts = ABSL_DEFAULT_LINKOPTS,
  674. visibility = [
  675. "//absl:__subpackages__",
  676. ],
  677. deps = [
  678. ":config",
  679. ":raw_logging_internal",
  680. ],
  681. )
  682. cc_test(
  683. name = "scoped_set_env_test",
  684. size = "small",
  685. srcs = ["internal/scoped_set_env_test.cc"],
  686. copts = ABSL_TEST_COPTS,
  687. linkopts = ABSL_DEFAULT_LINKOPTS,
  688. deps = [
  689. ":scoped_set_env",
  690. "@com_google_googletest//:gtest",
  691. "@com_google_googletest//:gtest_main",
  692. ],
  693. )
  694. cc_test(
  695. name = "log_severity_test",
  696. size = "small",
  697. srcs = ["log_severity_test.cc"],
  698. copts = ABSL_TEST_COPTS,
  699. linkopts = ABSL_DEFAULT_LINKOPTS,
  700. deps = [
  701. ":log_severity",
  702. "//absl/flags:flag_internal",
  703. "//absl/flags:marshalling",
  704. "//absl/strings",
  705. "@com_google_googletest//:gtest",
  706. "@com_google_googletest//:gtest_main",
  707. ],
  708. )
  709. cc_library(
  710. name = "strerror",
  711. srcs = ["internal/strerror.cc"],
  712. hdrs = ["internal/strerror.h"],
  713. copts = ABSL_DEFAULT_COPTS,
  714. linkopts = ABSL_DEFAULT_LINKOPTS,
  715. visibility = [
  716. "//absl:__subpackages__",
  717. ],
  718. deps = [
  719. ":config",
  720. ":core_headers",
  721. ":errno_saver",
  722. ],
  723. )
  724. cc_test(
  725. name = "strerror_test",
  726. size = "small",
  727. srcs = ["internal/strerror_test.cc"],
  728. copts = ABSL_TEST_COPTS,
  729. linkopts = ABSL_DEFAULT_LINKOPTS,
  730. deps = [
  731. ":strerror",
  732. "//absl/strings",
  733. "@com_google_googletest//:gtest",
  734. "@com_google_googletest//:gtest_main",
  735. ],
  736. )
  737. cc_binary(
  738. name = "strerror_benchmark",
  739. testonly = True,
  740. srcs = ["internal/strerror_benchmark.cc"],
  741. copts = ABSL_TEST_COPTS,
  742. linkopts = ABSL_DEFAULT_LINKOPTS,
  743. tags = ["benchmark"],
  744. visibility = ["//visibility:private"],
  745. deps = [
  746. ":strerror",
  747. "@com_github_google_benchmark//:benchmark_main",
  748. ],
  749. )
  750. cc_library(
  751. name = "fast_type_id",
  752. hdrs = ["internal/fast_type_id.h"],
  753. copts = ABSL_DEFAULT_COPTS,
  754. linkopts = ABSL_DEFAULT_LINKOPTS,
  755. visibility = [
  756. "//absl:__subpackages__",
  757. ],
  758. deps = [
  759. ":config",
  760. ],
  761. )
  762. cc_test(
  763. name = "fast_type_id_test",
  764. size = "small",
  765. srcs = ["internal/fast_type_id_test.cc"],
  766. copts = ABSL_TEST_COPTS,
  767. linkopts = ABSL_DEFAULT_LINKOPTS,
  768. deps = [
  769. ":fast_type_id",
  770. "@com_google_googletest//:gtest",
  771. "@com_google_googletest//:gtest_main",
  772. ],
  773. )
  774. cc_library(
  775. name = "prefetch",
  776. hdrs = [
  777. "prefetch.h",
  778. ],
  779. copts = ABSL_DEFAULT_COPTS,
  780. linkopts = ABSL_DEFAULT_LINKOPTS,
  781. deps = [
  782. ":config",
  783. ":core_headers",
  784. ],
  785. )
  786. cc_test(
  787. name = "prefetch_test",
  788. size = "small",
  789. srcs = [
  790. "prefetch_test.cc",
  791. ],
  792. copts = ABSL_TEST_COPTS,
  793. linkopts = ABSL_DEFAULT_LINKOPTS,
  794. deps = [
  795. ":prefetch",
  796. "@com_google_googletest//:gtest",
  797. "@com_google_googletest//:gtest_main",
  798. ],
  799. )
  800. cc_test(
  801. name = "unique_small_name_test",
  802. size = "small",
  803. srcs = ["internal/unique_small_name_test.cc"],
  804. copts = ABSL_TEST_COPTS,
  805. linkopts = ABSL_DEFAULT_LINKOPTS,
  806. linkstatic = 1,
  807. deps = [
  808. ":core_headers",
  809. "//absl/strings",
  810. "@com_google_googletest//:gtest",
  811. "@com_google_googletest//:gtest_main",
  812. ],
  813. )
  814. cc_test(
  815. name = "optimization_test",
  816. size = "small",
  817. srcs = ["optimization_test.cc"],
  818. copts = ABSL_TEST_COPTS,
  819. linkopts = ABSL_DEFAULT_LINKOPTS,
  820. deps = [
  821. ":core_headers",
  822. "//absl/types:optional",
  823. "@com_google_googletest//:gtest",
  824. "@com_google_googletest//:gtest_main",
  825. ],
  826. )