BUILD 18 KB

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