Rob Mohr | be98ead | 2019-11-14 07:16:40 -0800 | [diff] [blame] | 1 | # Copyright 2019 The Pigweed Authors |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not |
| 4 | # use this file except in compliance with the License. You may obtain a copy of |
| 5 | # the License at |
| 6 | # |
| 7 | # https://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 11 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 12 | # License for the specific language governing permissions and limitations under |
| 13 | # the License. |
Ted Pudlik | 3bf584b | 2024-07-29 23:56:48 +0000 | [diff] [blame] | 14 | load("@bazel_skylib//rules:copy_file.bzl", "copy_file") |
Chad Norvell | 6b20a02 | 2024-09-20 23:22:30 +0000 | [diff] [blame] | 15 | load("@hedron_compile_commands//:refresh_compile_commands.bzl", "refresh_compile_commands") |
Kayce Basques | c15953e | 2024-12-09 21:01:01 +0000 | [diff] [blame] | 16 | load("@pigweed//pw_build:compatibility.bzl", "incompatible_with_mcu") |
| 17 | load("@rules_python//sphinxdocs:sphinx_docs_library.bzl", "sphinx_docs_library") |
Rob Mohr | be98ead | 2019-11-14 07:16:40 -0800 | [diff] [blame] | 18 | |
Rob Mohr | 5fc2541 | 2021-06-23 09:35:23 -0700 | [diff] [blame] | 19 | licenses(["notice"]) |
Nathaniel Brough | a1113be | 2021-03-07 09:05:41 +0800 | [diff] [blame] | 20 | |
Darren Chan | c3dfc39 | 2024-04-03 21:10:08 +0000 | [diff] [blame] | 21 | # Needed for releasing //pw_bluetooth_sapphire/fuchsia/bt_host. |
| 22 | exports_files( |
| 23 | ["LICENSE"], |
| 24 | visibility = [":__subpackages__"], |
| 25 | ) |
| 26 | |
Nathaniel Brough | a1113be | 2021-03-07 09:05:41 +0800 | [diff] [blame] | 27 | exports_files( |
Ted Pudlik | 44c6eb5 | 2024-05-15 22:43:30 +0000 | [diff] [blame] | 28 | [ |
| 29 | "pigweed.json", |
Kayce Basques | 819e758 | 2024-10-05 01:07:49 +0000 | [diff] [blame] | 30 | "PIGWEED_MODULES", |
Ted Pudlik | 44c6eb5 | 2024-05-15 22:43:30 +0000 | [diff] [blame] | 31 | "tsconfig.json", |
| 32 | ], |
Ted Pudlik | 64110f5 | 2022-01-14 21:09:44 +0000 | [diff] [blame] | 33 | visibility = [":__subpackages__"], |
Nathaniel Brough | a1113be | 2021-03-07 09:05:41 +0800 | [diff] [blame] | 34 | ) |
Ted Pudlik | 3bf584b | 2024-07-29 23:56:48 +0000 | [diff] [blame] | 35 | |
| 36 | # Symlink to clangd, for user convenience. |
| 37 | copy_file( |
| 38 | name = "copy_clangd", |
| 39 | src = "@llvm_toolchain//:bin/clangd", |
| 40 | out = "clangd", |
| 41 | allow_symlink = True, |
| 42 | ) |
Chad Norvell | 6b20a02 | 2024-09-20 23:22:30 +0000 | [diff] [blame] | 43 | |
| 44 | # The Fuchsia SDK is only supported on Linux hosts, so the target that |
| 45 | # generates compile commands for targets built for Fuchsia is separate from |
| 46 | # the more general-purpose `refresh_compile_commands` target. |
| 47 | refresh_compile_commands( |
| 48 | name = "refresh_compile_commands_for_fuchsia_sdk", |
| 49 | out_dir = ".compile_commands", |
| 50 | target_compatible_with = select({ |
| 51 | "@platforms//os:linux": [], |
| 52 | "//conditions:default": ["@platforms//:incompatible"], |
| 53 | }), |
| 54 | target_groups = { |
| 55 | "fuchsia": [ |
| 56 | [ |
| 57 | "//pw_bluetooth_sapphire/fuchsia/bt_host:pkg.arm64", |
| 58 | "--config=fuchsia", |
| 59 | ], |
| 60 | ], |
| 61 | }, |
| 62 | ) |
Kayce Basques | c15953e | 2024-12-09 21:01:01 +0000 | [diff] [blame] | 63 | |
| 64 | sphinx_docs_library( |
| 65 | name = "docs", |
| 66 | srcs = [ |
| 67 | "Kconfig.zephyr", |
| 68 | ], |
| 69 | target_compatible_with = incompatible_with_mcu(), |
| 70 | visibility = ["//visibility:public"], |
| 71 | ) |