Nathaniel Brough | 82cf687 | 2021-02-16 15:51:57 +0800 | [diff] [blame] | 1 | # Copyright 2021 The Pigweed Authors |
Wyatt Hepler | c542a5d | 2020-01-15 15:43:10 -0800 | [diff] [blame] | 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 | |
| 15 | load( |
| 16 | "//pw_build:pigweed.bzl", |
| 17 | "pw_cc_library", |
| 18 | "pw_cc_test", |
| 19 | ) |
Nathaniel Brough | 82cf687 | 2021-02-16 15:51:57 +0800 | [diff] [blame] | 20 | load( |
| 21 | "@bazel_embedded//toolchains/tools/include_tools:defs.bzl", |
| 22 | "cc_injected_toolchain_header_library", |
| 23 | "cc_polyfill_toolchain_library", |
| 24 | ) |
Wyatt Hepler | c542a5d | 2020-01-15 15:43:10 -0800 | [diff] [blame] | 25 | |
| 26 | package(default_visibility = ["//visibility:public"]) |
| 27 | |
| 28 | licenses(["notice"]) # Apache License 2.0 |
| 29 | |
Nathaniel Brough | 82cf687 | 2021-02-16 15:51:57 +0800 | [diff] [blame] | 30 | cc_injected_toolchain_header_library( |
| 31 | name = "toolchain_injected_headers", |
| 32 | hdrs = ["language_features.h"], |
| 33 | ) |
| 34 | |
| 35 | cc_polyfill_toolchain_library( |
| 36 | name = "toolchain_polyfill_overrides", |
| 37 | hdrs = [ |
| 38 | "language_features.h", |
| 39 | "public_overrides/array", |
| 40 | "public_overrides/assert.h", |
| 41 | "public_overrides/bit", |
| 42 | "public_overrides/cstddef", |
| 43 | "public_overrides/iterator", |
| 44 | "public_overrides/type_traits", |
| 45 | "public_overrides/utility", |
| 46 | "standard_library_public/pw_polyfill/standard_library/array.h", |
| 47 | "standard_library_public/pw_polyfill/standard_library/assert.h", |
| 48 | "standard_library_public/pw_polyfill/standard_library/bit.h", |
| 49 | "standard_library_public/pw_polyfill/standard_library/cstddef.h", |
| 50 | "standard_library_public/pw_polyfill/standard_library/iterator.h", |
| 51 | "standard_library_public/pw_polyfill/standard_library/namespace.h", |
| 52 | "standard_library_public/pw_polyfill/standard_library/type_traits.h", |
| 53 | "standard_library_public/pw_polyfill/standard_library/utility.h", |
| 54 | ], |
| 55 | system_includes = [ |
| 56 | "public_overrides", |
| 57 | "public", |
| 58 | "standard_library_public", |
| 59 | ], |
| 60 | ) |
| 61 | |
Wyatt Hepler | c542a5d | 2020-01-15 15:43:10 -0800 | [diff] [blame] | 62 | pw_cc_library( |
| 63 | name = "pw_polyfill", |
| 64 | hdrs = [ |
Wyatt Hepler | 6c331ae | 2020-08-04 10:05:11 -0700 | [diff] [blame] | 65 | "public/pw_polyfill/language_feature_macros.h", |
Wyatt Hepler | c542a5d | 2020-01-15 15:43:10 -0800 | [diff] [blame] | 66 | "public/pw_polyfill/standard.h", |
| 67 | ], |
| 68 | includes = ["public"], |
| 69 | deps = [":standard_library"], |
| 70 | ) |
| 71 | |
| 72 | pw_cc_library( |
| 73 | name = "overrides", |
Wyatt Hepler | 6c331ae | 2020-08-04 10:05:11 -0700 | [diff] [blame] | 74 | srcs = ["language_features.h"], |
Wyatt Hepler | c542a5d | 2020-01-15 15:43:10 -0800 | [diff] [blame] | 75 | hdrs = [ |
Wyatt Hepler | 8e59f4d | 2020-08-27 10:34:21 -0700 | [diff] [blame] | 76 | "public_overrides/array", |
Wyatt Hepler | ac6cdf2 | 2020-01-24 13:35:09 -0800 | [diff] [blame] | 77 | "public_overrides/assert.h", |
Wyatt Hepler | ecf1923 | 2020-09-02 14:35:09 -0700 | [diff] [blame] | 78 | "public_overrides/bit", |
Wyatt Hepler | c542a5d | 2020-01-15 15:43:10 -0800 | [diff] [blame] | 79 | "public_overrides/cstddef", |
| 80 | "public_overrides/iterator", |
| 81 | "public_overrides/type_traits", |
Wyatt Hepler | 8e59f4d | 2020-08-27 10:34:21 -0700 | [diff] [blame] | 82 | "public_overrides/utility", |
Wyatt Hepler | c542a5d | 2020-01-15 15:43:10 -0800 | [diff] [blame] | 83 | ], |
Wyatt Hepler | 6c331ae | 2020-08-04 10:05:11 -0700 | [diff] [blame] | 84 | copts = [ |
| 85 | "-include", |
| 86 | "language_features.h", |
| 87 | ], |
Wyatt Hepler | c542a5d | 2020-01-15 15:43:10 -0800 | [diff] [blame] | 88 | includes = ["public_overrides"], |
| 89 | deps = [":standard_library"], |
| 90 | ) |
| 91 | |
| 92 | pw_cc_library( |
| 93 | name = "standard_library", |
| 94 | hdrs = [ |
Wyatt Hepler | 8e59f4d | 2020-08-27 10:34:21 -0700 | [diff] [blame] | 95 | "standard_library_public/pw_polyfill/standard_library/array.h", |
Wyatt Hepler | ac6cdf2 | 2020-01-24 13:35:09 -0800 | [diff] [blame] | 96 | "standard_library_public/pw_polyfill/standard_library/assert.h", |
Wyatt Hepler | ecf1923 | 2020-09-02 14:35:09 -0700 | [diff] [blame] | 97 | "standard_library_public/pw_polyfill/standard_library/bit.h", |
Wyatt Hepler | c542a5d | 2020-01-15 15:43:10 -0800 | [diff] [blame] | 98 | "standard_library_public/pw_polyfill/standard_library/cstddef.h", |
| 99 | "standard_library_public/pw_polyfill/standard_library/iterator.h", |
Wyatt Hepler | 023f35b | 2020-07-01 09:40:50 -0700 | [diff] [blame] | 100 | "standard_library_public/pw_polyfill/standard_library/namespace.h", |
Wyatt Hepler | c542a5d | 2020-01-15 15:43:10 -0800 | [diff] [blame] | 101 | "standard_library_public/pw_polyfill/standard_library/type_traits.h", |
Wyatt Hepler | 8e59f4d | 2020-08-27 10:34:21 -0700 | [diff] [blame] | 102 | "standard_library_public/pw_polyfill/standard_library/utility.h", |
Wyatt Hepler | c542a5d | 2020-01-15 15:43:10 -0800 | [diff] [blame] | 103 | ], |
| 104 | includes = ["standard_library_public"], |
| 105 | visibility = ["//visibility:private"], |
| 106 | ) |
| 107 | |
| 108 | pw_cc_test( |
| 109 | name = "default_cpp_test", |
| 110 | srcs = [ |
| 111 | "test.cc", |
| 112 | ], |
| 113 | deps = [ |
| 114 | ":pw_polyfill", |
Rob Mohr | c8b5552 | 2020-04-07 07:27:31 -0700 | [diff] [blame] | 115 | ":standard_library", |
Rob Mohr | 0681948 | 2020-04-06 13:25:43 -0700 | [diff] [blame] | 116 | "//pw_unit_test", |
Wyatt Hepler | c542a5d | 2020-01-15 15:43:10 -0800 | [diff] [blame] | 117 | ], |
| 118 | ) |