Skip to content

Commit

Permalink
bazel: Generate compile commands for Fuchsia
Browse files Browse the repository at this point in the history
For now, this just includes some targets that are only buildable in
Bazel and therefore can't have compile commands generated by GN.

Fixes: 368654273
Change-Id: Ic8585f44b9caabf0c7b247fcaa9f4f3ced2dec14
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/237133
Commit-Queue: Ben Lawson <[email protected]>
Docs-Not-Needed: Ben Lawson <[email protected]>
Commit-Queue: Chad Norvell <[email protected]>
Lint: Lint 🤖 <[email protected]>
Reviewed-by: Ben Lawson <[email protected]>
  • Loading branch information
chadnorvell authored and CQ Bot Account committed Sep 20, 2024
1 parent da9a7e7 commit 6b20a02
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# License for the specific language governing permissions and limitations under
# the License.
load("@bazel_skylib//rules:copy_file.bzl", "copy_file")
load("@hedron_compile_commands//:refresh_compile_commands.bzl", "refresh_compile_commands")

licenses(["notice"])

Expand All @@ -36,3 +37,23 @@ copy_file(
out = "clangd",
allow_symlink = True,
)

# The Fuchsia SDK is only supported on Linux hosts, so the target that
# generates compile commands for targets built for Fuchsia is separate from
# the more general-purpose `refresh_compile_commands` target.
refresh_compile_commands(
name = "refresh_compile_commands_for_fuchsia_sdk",
out_dir = ".compile_commands",
target_compatible_with = select({
"@platforms//os:linux": [],
"//conditions:default": ["@platforms//:incompatible"],
}),
target_groups = {
"fuchsia": [
[
"//pw_bluetooth_sapphire/fuchsia/bt_host:pkg.arm64",
"--config=fuchsia",
],
],
},
)

0 comments on commit 6b20a02

Please sign in to comment.