BUILD 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821
  1. # Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. # Exceptions. See /LICENSE for license information.
  3. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. load("@rules_shell//shell:sh_test.bzl", "sh_test")
  5. load("//bazel/cc_rules:defs.bzl", "cc_binary", "cc_library", "cc_test")
  6. load("//bazel/version:rules.bzl", "expand_version_build_info")
  7. package(default_visibility = ["//visibility:public"])
  8. cc_library(
  9. name = "array_stack",
  10. hdrs = ["array_stack.h"],
  11. deps = [
  12. ":check",
  13. "@llvm-project//llvm:Support",
  14. ],
  15. )
  16. cc_test(
  17. name = "array_stack_test",
  18. size = "small",
  19. srcs = ["array_stack_test.cpp"],
  20. deps = [
  21. ":array_stack",
  22. "//testing/base:gtest_main",
  23. "@googletest//:gtest",
  24. ],
  25. )
  26. cc_library(
  27. name = "bazel_working_dir",
  28. hdrs = ["bazel_working_dir.h"],
  29. deps = [
  30. "@llvm-project//llvm:Support",
  31. ],
  32. )
  33. cc_library(
  34. name = "build_data",
  35. srcs = [
  36. "build_data.cpp",
  37. "build_data_linkstamp.h",
  38. ],
  39. hdrs = ["build_data.h"],
  40. linkstamp = "build_data_linkstamp.cpp",
  41. deps = ["@llvm-project//llvm:Support"],
  42. )
  43. cc_test(
  44. name = "build_data_test",
  45. size = "small",
  46. srcs = ["build_data_test.cpp"],
  47. deps = [
  48. ":build_data",
  49. ":ostream",
  50. "//testing/base:gtest_main",
  51. "@googletest//:gtest",
  52. ],
  53. )
  54. cc_library(
  55. name = "command_line",
  56. srcs = ["command_line.cpp"],
  57. hdrs = ["command_line.h"],
  58. deps = [
  59. ":check",
  60. ":error",
  61. ":ostream",
  62. ":raw_string_ostream",
  63. "@llvm-project//llvm:Support",
  64. ],
  65. )
  66. cc_test(
  67. name = "command_line_test",
  68. size = "small",
  69. srcs = ["command_line_test.cpp"],
  70. deps = [
  71. ":command_line",
  72. ":error_test_helpers",
  73. ":raw_string_ostream",
  74. "//testing/base:gtest_main",
  75. "@googletest//:gtest",
  76. "@llvm-project//llvm:Support",
  77. ],
  78. )
  79. cc_library(
  80. name = "check",
  81. srcs = [
  82. "check_internal.cpp",
  83. "check_internal.h",
  84. ],
  85. hdrs = ["check.h"],
  86. deps = [
  87. ":ostream",
  88. ":template_string",
  89. "@llvm-project//llvm:Support",
  90. ],
  91. )
  92. cc_test(
  93. name = "check_test",
  94. size = "small",
  95. srcs = ["check_test.cpp"],
  96. deps = [
  97. ":check",
  98. "//testing/base:gtest_main",
  99. "@googletest//:gtest",
  100. ],
  101. )
  102. cc_library(
  103. name = "concepts",
  104. hdrs = ["concepts.h"],
  105. )
  106. cc_library(
  107. name = "emplace_by_calling",
  108. hdrs = ["emplace_by_calling.h"],
  109. )
  110. cc_test(
  111. name = "emplace_by_calling_test",
  112. srcs = ["emplace_by_calling_test.cpp"],
  113. deps = [
  114. ":emplace_by_calling",
  115. "//testing/base:gtest_main",
  116. "@googletest//:gtest",
  117. ],
  118. )
  119. cc_library(
  120. name = "enum_base",
  121. hdrs = ["enum_base.h"],
  122. deps = [
  123. "//common:ostream",
  124. "@llvm-project//llvm:Support",
  125. ],
  126. )
  127. cc_library(
  128. name = "enum_base_test_def",
  129. testonly = 1,
  130. textual_hdrs = ["enum_base_test.def"],
  131. )
  132. cc_test(
  133. name = "enum_base_test",
  134. size = "small",
  135. srcs = ["enum_base_test.cpp"],
  136. deps = [
  137. ":enum_base",
  138. ":enum_base_test_def",
  139. ":raw_string_ostream",
  140. "//testing/base:gtest_main",
  141. "@googletest//:gtest",
  142. ],
  143. )
  144. cc_library(
  145. name = "enum_mask_base",
  146. hdrs = ["enum_mask_base.h"],
  147. deps = [
  148. ":enum_base",
  149. "@llvm-project//llvm:Support",
  150. ],
  151. )
  152. cc_test(
  153. name = "enum_mask_base_test",
  154. size = "small",
  155. srcs = ["enum_mask_base_test.cpp"],
  156. deps = [
  157. ":enum_mask_base",
  158. ":raw_string_ostream",
  159. "//testing/base:gtest_main",
  160. "@googletest//:gtest",
  161. ],
  162. )
  163. cc_library(
  164. name = "error",
  165. hdrs = ["error.h"],
  166. deps = [
  167. ":check",
  168. ":ostream",
  169. ":raw_string_ostream",
  170. "@llvm-project//llvm:Support",
  171. ],
  172. )
  173. cc_library(
  174. name = "error_test_helpers",
  175. testonly = 1,
  176. hdrs = ["error_test_helpers.h"],
  177. deps = [
  178. ":error",
  179. "@googletest//:gtest",
  180. ],
  181. )
  182. cc_test(
  183. name = "error_test",
  184. size = "small",
  185. srcs = ["error_test.cpp"],
  186. deps = [
  187. ":error",
  188. ":error_test_helpers",
  189. ":raw_string_ostream",
  190. "//testing/base:gtest_main",
  191. "@googletest//:gtest",
  192. ],
  193. )
  194. cc_library(
  195. name = "exe_path",
  196. srcs = ["exe_path.cpp"],
  197. hdrs = ["exe_path.h"],
  198. deps = [
  199. "@llvm-project//llvm:Support",
  200. ],
  201. )
  202. cc_test(
  203. name = "exe_path_test",
  204. size = "small",
  205. srcs = ["exe_path_test.cpp"],
  206. deps = [
  207. ":exe_path",
  208. "//testing/base:gtest_main",
  209. "@googletest//:gtest",
  210. "@llvm-project//llvm:Support",
  211. ],
  212. )
  213. cc_library(
  214. name = "filesystem",
  215. srcs = ["filesystem.cpp"],
  216. hdrs = ["filesystem.h"],
  217. deps = [
  218. ":build_data",
  219. ":check",
  220. ":error",
  221. ":ostream",
  222. ":raw_string_ostream",
  223. ":template_string",
  224. "@llvm-project//llvm:Support",
  225. ],
  226. )
  227. cc_test(
  228. name = "filesystem_test",
  229. size = "small",
  230. srcs = ["filesystem_test.cpp"],
  231. deps = [
  232. ":error_test_helpers",
  233. ":filesystem",
  234. "//testing/base:gtest_main",
  235. "@googletest//:gtest",
  236. "@llvm-project//llvm:Support",
  237. ],
  238. )
  239. cc_binary(
  240. name = "filesystem_benchmark",
  241. testonly = 1,
  242. srcs = ["filesystem_benchmark.cpp"],
  243. deps = [
  244. ":check",
  245. ":filesystem",
  246. "//testing/base:benchmark_main",
  247. "@abseil-cpp//absl/hash",
  248. "@abseil-cpp//absl/random",
  249. "@google_benchmark//:benchmark",
  250. "@llvm-project//llvm:Support",
  251. ],
  252. )
  253. sh_test(
  254. name = "filesystem_benchmark_test",
  255. size = "small",
  256. srcs = [":filesystem_benchmark"],
  257. args = [
  258. "--benchmark_min_time=1x",
  259. # Restrict the sizes to 4-digit ones or smaller to keep test times low.
  260. # The `$$` is repeated for Bazel escaping of `$`.
  261. "--benchmark_filter=^[^/]+(/[0-9]{1,4}(/[0-9]+)?)?/real_time$$",
  262. ],
  263. )
  264. cc_library(
  265. name = "find",
  266. hdrs = ["find.h"],
  267. deps = [
  268. ":check",
  269. ":ostream",
  270. ":raw_string_ostream",
  271. "@llvm-project//llvm:Support",
  272. ],
  273. )
  274. cc_test(
  275. name = "find_test",
  276. size = "small",
  277. srcs = ["find_test.cpp"],
  278. deps = [
  279. ":find",
  280. "//testing/base:gtest_main",
  281. "@googletest//:gtest",
  282. ],
  283. )
  284. cc_library(
  285. name = "growing_range",
  286. hdrs = ["growing_range.h"],
  287. )
  288. cc_test(
  289. name = "growing_range_test",
  290. size = "small",
  291. srcs = ["growing_range_test.cpp"],
  292. deps = [
  293. ":growing_range",
  294. "//testing/base:gtest_main",
  295. "@googletest//:gtest",
  296. ],
  297. )
  298. cc_library(
  299. name = "hashing",
  300. srcs = ["hashing.cpp"],
  301. hdrs = ["hashing.h"],
  302. deps = [
  303. ":check",
  304. ":ostream",
  305. "@llvm-project//llvm:Support",
  306. ],
  307. )
  308. cc_test(
  309. name = "hashing_test",
  310. size = "small",
  311. srcs = ["hashing_test.cpp"],
  312. deps = [
  313. ":hashing",
  314. ":raw_string_ostream",
  315. "//testing/base:gtest_main",
  316. "@googletest//:gtest",
  317. "@llvm-project//llvm:Support",
  318. ],
  319. )
  320. cc_binary(
  321. name = "hashing_benchmark",
  322. testonly = 1,
  323. srcs = ["hashing_benchmark.cpp"],
  324. deps = [
  325. ":check",
  326. ":hashing",
  327. "//testing/base:benchmark_main",
  328. "@abseil-cpp//absl/hash",
  329. "@abseil-cpp//absl/random",
  330. "@google_benchmark//:benchmark",
  331. "@llvm-project//llvm:Support",
  332. ],
  333. )
  334. cc_library(
  335. name = "hashtable_key_context",
  336. hdrs = ["hashtable_key_context.h"],
  337. deps = [
  338. ":hashing",
  339. "@llvm-project//llvm:Support",
  340. ],
  341. )
  342. cc_test(
  343. name = "hashtable_key_context_test",
  344. size = "small",
  345. srcs = ["hashtable_key_context_test.cpp"],
  346. deps = [
  347. ":hashtable_key_context",
  348. "//testing/base:gtest_main",
  349. "@googletest//:gtest",
  350. "@llvm-project//llvm:Support",
  351. ],
  352. )
  353. cc_library(
  354. name = "init_llvm",
  355. srcs = ["init_llvm.cpp"],
  356. hdrs = ["init_llvm.h"],
  357. deps = [
  358. "@llvm-project//llvm:Support",
  359. ],
  360. )
  361. # Link against this to cause `:init_llvm` to pull in all LLVM targets.
  362. #
  363. # Be careful when depending on this: it pulls in several hundred megabytes of
  364. # LLVM binary size in -c fastbuild. This should only be depended on by a
  365. # `cc_binary` or `cc_test` target, never a `cc_library`.
  366. cc_library(
  367. name = "all_llvm_targets",
  368. srcs = ["all_llvm_targets.cpp"],
  369. deps = [
  370. ":init_llvm",
  371. "@llvm-project//llvm:AllTargetsAsmParsers",
  372. "@llvm-project//llvm:AllTargetsCodeGens",
  373. "@llvm-project//llvm:Support",
  374. ],
  375. alwayslink = 1,
  376. )
  377. cc_library(
  378. name = "latch",
  379. srcs = ["latch.cpp"],
  380. hdrs = ["latch.h"],
  381. deps = [
  382. ":check",
  383. "@llvm-project//llvm:Support",
  384. ],
  385. )
  386. cc_test(
  387. name = "latch_test",
  388. size = "small",
  389. srcs = ["latch_test.cpp"],
  390. deps = [
  391. ":latch",
  392. "//testing/base:gtest_main",
  393. "@googletest//:gtest",
  394. "@llvm-project//llvm:Support",
  395. ],
  396. )
  397. cc_library(
  398. name = "map",
  399. hdrs = ["map.h"],
  400. deps = [
  401. ":check",
  402. ":concepts",
  403. ":hashtable_key_context",
  404. ":raw_hashtable",
  405. "@llvm-project//llvm:Support",
  406. ],
  407. )
  408. cc_test(
  409. name = "map_test",
  410. size = "small",
  411. srcs = ["map_test.cpp"],
  412. deps = [
  413. ":map",
  414. ":raw_hashtable_test_helpers",
  415. "//testing/base:gtest_main",
  416. "@googletest//:gtest",
  417. ],
  418. )
  419. cc_binary(
  420. name = "map_benchmark",
  421. testonly = 1,
  422. srcs = ["map_benchmark.cpp"],
  423. deps = [
  424. ":map",
  425. ":raw_hashtable_benchmark_helpers",
  426. "//testing/base:benchmark_main",
  427. "@abseil-cpp//absl/container:flat_hash_map",
  428. "@abseil-cpp//absl/random",
  429. "@boost_unordered",
  430. "@google_benchmark//:benchmark",
  431. "@llvm-project//llvm:Support",
  432. ],
  433. )
  434. sh_test(
  435. name = "map_benchmark_test",
  436. # The benchmark allocates a large amount of memory.
  437. size = "enormous",
  438. # We configure the test to run somewhat quickly.
  439. timeout = "moderate",
  440. srcs = [":map_benchmark"],
  441. args = [
  442. "--benchmark_min_time=1x",
  443. # The `$$` is repeated for Bazel escaping of `$`.
  444. "--benchmark_filter=^[^/]*/[1-9][0-9]{0,3}(/[0-9]+)?$$",
  445. ],
  446. )
  447. cc_library(
  448. name = "move_only",
  449. hdrs = ["move_only.h"],
  450. )
  451. cc_library(
  452. name = "ostream",
  453. hdrs = ["ostream.h"],
  454. deps = [
  455. "@llvm-project//llvm:Support",
  456. ],
  457. )
  458. cc_library(
  459. name = "pretty_stack_trace_function",
  460. hdrs = ["pretty_stack_trace_function.h"],
  461. deps = [
  462. "@llvm-project//llvm:Support",
  463. ],
  464. )
  465. cc_library(
  466. name = "raw_hashtable",
  467. srcs = ["raw_hashtable.cpp"],
  468. hdrs = ["raw_hashtable.h"],
  469. deps = [
  470. ":check",
  471. ":concepts",
  472. ":hashing",
  473. ":hashtable_key_context",
  474. ":raw_hashtable_metadata_group",
  475. "@llvm-project//llvm:Support",
  476. ],
  477. )
  478. cc_library(
  479. name = "raw_hashtable_metadata_group",
  480. srcs = ["raw_hashtable_metadata_group.cpp"],
  481. hdrs = ["raw_hashtable_metadata_group.h"],
  482. deps = [
  483. ":check",
  484. ":ostream",
  485. "@llvm-project//llvm:Support",
  486. ],
  487. )
  488. cc_binary(
  489. name = "raw_hashtable_metadata_group_benchmark",
  490. testonly = 1,
  491. srcs = ["raw_hashtable_metadata_group_benchmark.cpp"],
  492. deps = [
  493. ":raw_hashtable_metadata_group",
  494. "//testing/base:benchmark_main",
  495. "@abseil-cpp//absl/random",
  496. "@google_benchmark//:benchmark",
  497. "@llvm-project//llvm:Support",
  498. ],
  499. )
  500. sh_test(
  501. name = "raw_hashtable_metadata_group_benchmark_test",
  502. size = "small",
  503. srcs = ["raw_hashtable_metadata_group_benchmark"],
  504. args = [
  505. "--benchmark_min_time=1x",
  506. ],
  507. )
  508. cc_library(
  509. name = "raw_hashtable_benchmark_helpers",
  510. testonly = 1,
  511. srcs = ["raw_hashtable_benchmark_helpers.cpp"],
  512. hdrs = ["raw_hashtable_benchmark_helpers.h"],
  513. copts = [
  514. "-O2", # Always optimize to make testing benchmarks faster.
  515. ],
  516. deps = [
  517. ":check",
  518. ":hashing",
  519. ":raw_hashtable",
  520. ":set",
  521. "@abseil-cpp//absl/base:no_destructor",
  522. "@abseil-cpp//absl/hash",
  523. "@abseil-cpp//absl/random",
  524. "@boost_unordered",
  525. "@google_benchmark//:benchmark",
  526. "@llvm-project//llvm:Support",
  527. ],
  528. )
  529. cc_library(
  530. name = "raw_hashtable_test_helpers",
  531. testonly = 1,
  532. hdrs = ["raw_hashtable_test_helpers.h"],
  533. deps = [
  534. ":check",
  535. ":hashing",
  536. ":hashtable_key_context",
  537. ":ostream",
  538. ],
  539. )
  540. cc_library(
  541. name = "raw_string_ostream",
  542. hdrs = ["raw_string_ostream.h"],
  543. deps = [
  544. ":check",
  545. ":ostream",
  546. ],
  547. )
  548. cc_test(
  549. name = "raw_string_ostream_test",
  550. size = "small",
  551. srcs = ["raw_string_ostream_test.cpp"],
  552. deps = [
  553. ":raw_string_ostream",
  554. "//testing/base:gtest_main",
  555. "@googletest//:gtest",
  556. ],
  557. )
  558. cc_library(
  559. name = "set",
  560. hdrs = ["set.h"],
  561. deps = [
  562. ":check",
  563. ":hashtable_key_context",
  564. ":raw_hashtable",
  565. "@llvm-project//llvm:Support",
  566. ],
  567. )
  568. cc_test(
  569. name = "set_test",
  570. size = "small",
  571. srcs = ["set_test.cpp"],
  572. deps = [
  573. ":raw_hashtable_test_helpers",
  574. ":set",
  575. "//testing/base:gtest_main",
  576. "@googletest//:gtest",
  577. ],
  578. )
  579. cc_binary(
  580. name = "set_benchmark",
  581. testonly = 1,
  582. srcs = ["set_benchmark.cpp"],
  583. deps = [
  584. ":raw_hashtable_benchmark_helpers",
  585. ":set",
  586. "//testing/base:benchmark_main",
  587. "@abseil-cpp//absl/container:flat_hash_set",
  588. "@google_benchmark//:benchmark",
  589. "@llvm-project//llvm:Support",
  590. ],
  591. )
  592. sh_test(
  593. name = "set_benchmark_test",
  594. # The benchmark allocates a large amount of memory.
  595. size = "enormous",
  596. # We configure the test to run somewhat quickly.
  597. timeout = "moderate",
  598. srcs = [":set_benchmark"],
  599. args = [
  600. "--benchmark_min_time=1x",
  601. # The `$$` is repeated for Bazel escaping of `$`.
  602. "--benchmark_filter=^[^/]*/[1-9][0-9]{0,3}(/[0-9]+)?$$",
  603. ],
  604. )
  605. cc_library(
  606. name = "string_helpers",
  607. srcs = ["string_helpers.cpp"],
  608. hdrs = ["string_helpers.h"],
  609. deps = [
  610. ":check",
  611. ":error",
  612. "@llvm-project//llvm:Support",
  613. ],
  614. )
  615. cc_test(
  616. name = "string_helpers_test",
  617. size = "small",
  618. srcs = ["string_helpers_test.cpp"],
  619. deps = [
  620. ":string_helpers",
  621. "//testing/base:gtest_main",
  622. "@googletest//:gtest",
  623. "@llvm-project//llvm:Support",
  624. ],
  625. )
  626. cc_library(
  627. name = "struct_reflection",
  628. hdrs = ["struct_reflection.h"],
  629. )
  630. cc_test(
  631. name = "struct_reflection_test",
  632. size = "small",
  633. srcs = ["struct_reflection_test.cpp"],
  634. deps = [
  635. ":struct_reflection",
  636. "//testing/base:gtest_main",
  637. "@googletest//:gtest",
  638. ],
  639. )
  640. cc_library(
  641. name = "template_string",
  642. hdrs = ["template_string.h"],
  643. deps = [
  644. "@llvm-project//llvm:Support",
  645. ],
  646. )
  647. cc_test(
  648. name = "template_string_test",
  649. size = "small",
  650. srcs = ["template_string_test.cpp"],
  651. deps = [
  652. ":template_string",
  653. "//testing/base:gtest_main",
  654. "@googletest//:gtest",
  655. ],
  656. )
  657. cc_library(
  658. name = "type_enum",
  659. hdrs = ["type_enum.h"],
  660. deps = [":ostream"],
  661. )
  662. # The base version source file only uses non-stamped parts of the version
  663. # information so we expand it once here without any stamping.
  664. expand_version_build_info(
  665. name = "version_cpp_gen",
  666. out = "version.cpp",
  667. stamp = 0,
  668. template = "version.tmpl.cpp",
  669. )
  670. # Build a nostamp version of the stamp source, but mark its definitions as weak.
  671. # We'll include this in the library to satisfy definitions of library and test
  672. # users, but still allow binaries that want full build stamping to depend on the
  673. # stamp library below to override with strong, stamped definitions.
  674. expand_version_build_info(
  675. name = "version_nostamp_cpp_gen",
  676. out = "version_nostamp.cpp",
  677. stamp = 0,
  678. substitutions = {"MAKE_WEAK": "1"},
  679. template = "version_stamp.tmpl.cpp",
  680. )
  681. # Provides APIs for accessing Carbon version information.
  682. #
  683. # These provide full access to the major, minor, and patch version. It also
  684. # provides an API for querying version strings that may contain detailed build
  685. # information such as the commit SHA.
  686. #
  687. # By default, this provides the API and an *unstamped* implementations of
  688. # version strings. As a consequence, depending on this library doesn't introduce
  689. # any dependency on the commit SHA or loss of build caching.
  690. #
  691. # Targets that want full build info stamping in the data produced by these APIs
  692. # should additionally depend on `:version_stamp` below -- the data these APIs
  693. # return will be overridden in any binaries depending on that rule with the
  694. # fully stamped details.
  695. cc_library(
  696. name = "version",
  697. srcs = [
  698. "version.cpp",
  699. "version_nostamp.cpp",
  700. ],
  701. hdrs = ["version.h"],
  702. deps = [
  703. "@llvm-project//llvm:Support",
  704. ],
  705. )
  706. # Generate the fully stamped sourcefile if stamping is enabled in the build.
  707. expand_version_build_info(
  708. name = "version_stamp_cpp_gen",
  709. out = "version_stamp.cpp",
  710. template = "version_stamp.tmpl.cpp",
  711. )
  712. # Depend on this library to enable fully-stamped build information in the
  713. # version API provided by `:version`. This doesn't provide the API, it injects
  714. # an override of stamped versions of the data.
  715. #
  716. # Note that depending on this will significantly reduce build caching with
  717. # `--stamp` builds. It should be used sparingly, typically in user-facing
  718. # binaries or systems that need to render a maximally detailed version string
  719. # with build information stamped into it.
  720. cc_library(
  721. name = "version_stamp",
  722. srcs = ["version_stamp.cpp"],
  723. deps = [
  724. ":version",
  725. "@llvm-project//llvm:Support",
  726. ],
  727. )
  728. cc_library(
  729. name = "vlog",
  730. hdrs = ["vlog.h"],
  731. deps = [
  732. ":ostream",
  733. ":template_string",
  734. "@llvm-project//llvm:Support",
  735. ],
  736. )
  737. cc_test(
  738. name = "vlog_test",
  739. size = "small",
  740. srcs = ["vlog_test.cpp"],
  741. deps = [
  742. ":raw_string_ostream",
  743. ":vlog",
  744. "//testing/base:gtest_main",
  745. "@googletest//:gtest",
  746. ],
  747. )