xref: /aosp_15_r20/external/pigweed/third_party/fuchsia/BUILD.bazel (revision 61c4878ac05f98d0ceed94b57d316916de578985)
1# Copyright 2021 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.
14
15load("@rules_license//rules:license.bzl", "license")
16
17package(
18    default_applicable_licenses = [":license_fuchsia"],
19    default_visibility = ["//visibility:public"],
20)
21
22license(
23    name = "license_fuchsia",
24    package_name = "Fuchsia (third_party)",
25    license_text = "repo/LICENSE",
26)
27
28exports_files(["repo/LICENSE"])
29
30# Allows downstream projects to provide an alternative implementation of fit.
31#
32# Intended for projects that depend on both Pigweed and Fuchsia, and want to
33# use the Fuchsia implementation directly to avoid ODR violations.
34label_flag(
35    name = "fit",
36    build_setting_default = ":fit_impl",
37)
38
39cc_library(
40    name = "fit_impl",
41    srcs = [
42        "repo/sdk/lib/fit/include/lib/fit/internal/compiler.h",
43        "repo/sdk/lib/fit/include/lib/fit/internal/function.h",
44        "repo/sdk/lib/fit/include/lib/fit/internal/result.h",
45        "repo/sdk/lib/fit/include/lib/fit/internal/utility.h",
46    ],
47    hdrs = [
48        "repo/sdk/lib/fit/include/lib/fit/defer.h",
49        "repo/sdk/lib/fit/include/lib/fit/function.h",
50        "repo/sdk/lib/fit/include/lib/fit/nullable.h",
51        "repo/sdk/lib/fit/include/lib/fit/result.h",
52        "repo/sdk/lib/fit/include/lib/fit/traits.h",
53    ],
54    includes = ["repo/sdk/lib/fit/include"],
55    deps = [
56        ":stdcompat",
57        "//pw_assert",
58    ],
59)
60
61cc_library(
62    name = "stdcompat",
63    srcs = [
64        "repo/sdk/lib/stdcompat/include/lib/stdcompat/bit.h",
65        "repo/sdk/lib/stdcompat/include/lib/stdcompat/internal/constructors.h",
66        "repo/sdk/lib/stdcompat/include/lib/stdcompat/internal/exception.h",
67        "repo/sdk/lib/stdcompat/include/lib/stdcompat/internal/functional.h",
68        "repo/sdk/lib/stdcompat/include/lib/stdcompat/internal/storage.h",
69        "repo/sdk/lib/stdcompat/include/lib/stdcompat/internal/type_traits.h",
70        "repo/sdk/lib/stdcompat/include/lib/stdcompat/internal/utility.h",
71        "repo/sdk/lib/stdcompat/include/lib/stdcompat/memory.h",
72    ],
73    hdrs = [
74        "repo/sdk/lib/stdcompat/include/lib/stdcompat/functional.h",
75        "repo/sdk/lib/stdcompat/include/lib/stdcompat/internal/bit.h",
76        "repo/sdk/lib/stdcompat/include/lib/stdcompat/optional.h",
77        "repo/sdk/lib/stdcompat/include/lib/stdcompat/type_traits.h",
78        "repo/sdk/lib/stdcompat/include/lib/stdcompat/utility.h",
79        "repo/sdk/lib/stdcompat/include/lib/stdcompat/version.h",
80    ],
81    includes = ["repo/sdk/lib/stdcompat/include"],
82)
83