Skip to content

Commit 4a89362

Browse files
committed
Generate compile_commands.json
1 parent dbc95b1 commit 4a89362

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
bazel-*
22
.idea
33
.vscode
4+
5+
compile_commands.json

WORKSPACE.bazel

+14
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,17 @@ http_archive(
1313
load("@rules_foreign_cc//foreign_cc:repositories.bzl", "rules_foreign_cc_dependencies")
1414

1515
rules_foreign_cc_dependencies()
16+
17+
# Hedron's Compile Commands Extractor for Bazel
18+
# https://github.com/hedronvision/bazel-compile-commands-extractor
19+
http_archive(
20+
name = "hedron_compile_commands",
21+
22+
# Replace the commit hash in both places (below) with the latest, rather than using the stale one here.
23+
# Even better, set up Renovate and let it do the work for you (see "Suggestion: Updates" in the README).
24+
url = "https://github.com/hedronvision/bazel-compile-commands-extractor/archive/e16062717d9b098c3c2ac95717d2b3e661c50608.tar.gz",
25+
strip_prefix = "bazel-compile-commands-extractor-e16062717d9b098c3c2ac95717d2b3e661c50608",
26+
# When you first run this tool, it'll recommend a sha256 hash to put here with a message like: "DEBUG: Rule 'hedron_compile_commands' indicated that a canonical reproducible form can be obtained by modifying arguments sha256 = ..."
27+
)
28+
load("@hedron_compile_commands//:workspace_setup.bzl", "hedron_compile_commands_setup")
29+
hedron_compile_commands_setup()

0 commit comments

Comments
 (0)