BUILD 18 KB

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