blob: e1c3f1171abbd439596b8bf4ddacbdbad435a2ab [file] [log] [blame]
Wyatt Hepler588907a2020-01-16 16:34:58 -08001# Copyright 2020 The Pigweed Authors
Wyatt Hepler77105652019-11-06 17:50:03 -08002#
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 Montanezfb3d3fb2020-06-09 18:12:12 -070015import("//build_overrides/pigweed.gni")
16
Alexei Frolovedd2f142020-06-09 19:11:27 -070017import("$dir_pw_build/target_types.gni")
Wyatt Hepleree3e02f2019-12-05 10:52:31 -080018import("$dir_pw_docgen/docs.gni")
Wyatt Hepler77105652019-11-06 17:50:03 -080019import("$dir_pw_unit_test/test.gni")
Wyatt Heplerd49f8fe2020-10-15 10:13:47 -070020
Wyatt Hepler97a068c2021-01-19 16:50:04 -080021config("public_config") {
22 include_dirs = [ "public" ]
23 visibility = [ ":*" ]
Wyatt Hepler77105652019-11-06 17:50:03 -080024}
25
Wyatt Hepler97a068c2021-01-19 16:50:04 -080026config("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.
33pw_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 Frolovedd2f142020-06-09 19:11:27 -070043pw_source_set("pw_span") {
Wyatt Hepler7abd8cc2021-01-19 16:49:33 -080044 remove_public_deps = [ "*" ]
Wyatt Hepler97a068c2021-01-19 16:50:04 -080045 public_configs = [ ":public_config" ]
Rob Mohra0ba54f2020-02-27 11:43:49 -080046 public_deps = [ "$dir_pw_polyfill" ]
Wyatt Hepler69a51902020-06-22 10:42:53 -070047 sources = [ "public/pw_span/internal/span.h" ]
Wyatt Hepler97a068c2021-01-19 16:50:04 -080048 visibility = [ ":*" ]
Wyatt Hepler77105652019-11-06 17:50:03 -080049}
50
Alexei Frolova454c682019-11-19 10:55:07 -080051pw_test_group("tests") {
Wyatt Hepler9f392342020-07-08 10:11:33 -070052 tests = [ ":test" ]
Alexei Frolova454c682019-11-19 10:55:07 -080053}
54
Wyatt Hepler77105652019-11-06 17:50:03 -080055pw_test("test") {
Rob Mohra0ba54f2020-02-27 11:43:49 -080056 deps = [ ":pw_span" ]
Ewout van Bekkumb80cd7a2020-10-20 12:44:40 -070057 remove_configs = [ "$dir_pw_build:extra_strict_warnings" ]
Rob Mohra0ba54f2020-02-27 11:43:49 -080058 sources = [ "span_test.cc" ]
Wyatt Hepler77105652019-11-06 17:50:03 -080059}
Wyatt Hepleree3e02f2019-12-05 10:52:31 -080060
61pw_doc_group("docs") {
Rob Mohra0ba54f2020-02-27 11:43:49 -080062 sources = [ "docs.rst" ]
Wyatt Hepleree3e02f2019-12-05 10:52:31 -080063}