Wyatt Hepler | 588907a | 2020-01-16 16:34:58 -0800 | [diff] [blame] | 1 | # Copyright 2020 The Pigweed Authors |
Wyatt Hepler | 7710565 | 2019-11-06 17:50:03 -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 | |
Armando Montanez | fb3d3fb | 2020-06-09 18:12:12 -0700 | [diff] [blame] | 15 | import("//build_overrides/pigweed.gni") |
| 16 | |
Alexei Frolov | edd2f14 | 2020-06-09 19:11:27 -0700 | [diff] [blame] | 17 | import("$dir_pw_build/target_types.gni") |
Wyatt Hepler | ee3e02f | 2019-12-05 10:52:31 -0800 | [diff] [blame] | 18 | import("$dir_pw_docgen/docs.gni") |
Wyatt Hepler | 7710565 | 2019-11-06 17:50:03 -0800 | [diff] [blame] | 19 | import("$dir_pw_unit_test/test.gni") |
Wyatt Hepler | d49f8fe | 2020-10-15 10:13:47 -0700 | [diff] [blame] | 20 | |
Wyatt Hepler | 97a068c | 2021-01-19 16:50:04 -0800 | [diff] [blame] | 21 | config("public_config") { |
| 22 | include_dirs = [ "public" ] |
| 23 | visibility = [ ":*" ] |
Wyatt Hepler | 7710565 | 2019-11-06 17:50:03 -0800 | [diff] [blame] | 24 | } |
| 25 | |
Wyatt Hepler | 97a068c | 2021-01-19 16:50:04 -0800 | [diff] [blame] | 26 | config("overrides_config") { |
| 27 | include_dirs = [ "public_overrides" ] |
| 28 | visibility = [ ":*" ] |
| 29 | } |
| 30 | |
| 31 | # This source set provides the <span> header, which is accessed only through |
| 32 | # pw_polyfill. |
| 33 | pw_source_set("polyfill") { |
| 34 | remove_public_deps = [ "*" ] |
| 35 | public_configs = [ ":overrides_config" ] |
| 36 | public_deps = [ ":pw_span" ] |
| 37 | public = [ "public_overrides/span" ] |
| 38 | visibility = [ "$dir_pw_polyfill:*" ] |
| 39 | } |
| 40 | |
| 41 | # This source set provides the internal span.h header included by <span>. This |
| 42 | # source set is only used by pw_polyfill, so its visibility is restricted. |
Alexei Frolov | edd2f14 | 2020-06-09 19:11:27 -0700 | [diff] [blame] | 43 | pw_source_set("pw_span") { |
Wyatt Hepler | 7abd8cc | 2021-01-19 16:49:33 -0800 | [diff] [blame] | 44 | remove_public_deps = [ "*" ] |
Wyatt Hepler | 97a068c | 2021-01-19 16:50:04 -0800 | [diff] [blame] | 45 | public_configs = [ ":public_config" ] |
Rob Mohr | a0ba54f | 2020-02-27 11:43:49 -0800 | [diff] [blame] | 46 | public_deps = [ "$dir_pw_polyfill" ] |
Wyatt Hepler | 69a5190 | 2020-06-22 10:42:53 -0700 | [diff] [blame] | 47 | sources = [ "public/pw_span/internal/span.h" ] |
Wyatt Hepler | 97a068c | 2021-01-19 16:50:04 -0800 | [diff] [blame] | 48 | visibility = [ ":*" ] |
Wyatt Hepler | 7710565 | 2019-11-06 17:50:03 -0800 | [diff] [blame] | 49 | } |
| 50 | |
Alexei Frolov | a454c68 | 2019-11-19 10:55:07 -0800 | [diff] [blame] | 51 | pw_test_group("tests") { |
Wyatt Hepler | 9f39234 | 2020-07-08 10:11:33 -0700 | [diff] [blame] | 52 | tests = [ ":test" ] |
Alexei Frolov | a454c68 | 2019-11-19 10:55:07 -0800 | [diff] [blame] | 53 | } |
| 54 | |
Wyatt Hepler | 7710565 | 2019-11-06 17:50:03 -0800 | [diff] [blame] | 55 | pw_test("test") { |
Rob Mohr | a0ba54f | 2020-02-27 11:43:49 -0800 | [diff] [blame] | 56 | deps = [ ":pw_span" ] |
Ewout van Bekkum | b80cd7a | 2020-10-20 12:44:40 -0700 | [diff] [blame] | 57 | remove_configs = [ "$dir_pw_build:extra_strict_warnings" ] |
Rob Mohr | a0ba54f | 2020-02-27 11:43:49 -0800 | [diff] [blame] | 58 | sources = [ "span_test.cc" ] |
Wyatt Hepler | 7710565 | 2019-11-06 17:50:03 -0800 | [diff] [blame] | 59 | } |
Wyatt Hepler | ee3e02f | 2019-12-05 10:52:31 -0800 | [diff] [blame] | 60 | |
| 61 | pw_doc_group("docs") { |
Rob Mohr | a0ba54f | 2020-02-27 11:43:49 -0800 | [diff] [blame] | 62 | sources = [ "docs.rst" ] |
Wyatt Hepler | ee3e02f | 2019-12-05 10:52:31 -0800 | [diff] [blame] | 63 | } |