1 # Copyright 2021 The Pigweed Authors
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
7 # https://www.apache.org/licenses/LICENSE-2.0
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
15 import("//build_overrides/pigweed.gni")
17 import("$dir_pw_build/target_types.gni")
18 import("$dir_pw_docgen/docs.gni")
19 import("$dir_pw_unit_test/test.gni")
22 include_dirs = [ "public" ]
26 pw_source_set("pw_polyfill") {
27 public_configs = [ ":public" ]
28 remove_public_deps = [ "*" ]
29 public_deps = [ ":standard_library" ]
31 "public/pw_polyfill/language_feature_macros.h",
32 "public/pw_polyfill/standard.h",
36 config("overrides_config") {
37 include_dirs = [ "public_overrides" ]
39 # Use -include to include the language features header in dependent files,
40 # without requiring a #include. This allows the use of newer C++ language
41 # features in older C++ versions without an explicit include.
43 rebase_path("language_features.h"),
48 pw_source_set("overrides") {
49 public_configs = [ ":overrides_config" ]
50 remove_public_deps = [ "*" ]
53 "$dir_pw_span:polyfill",
56 "public_overrides/array",
57 "public_overrides/assert.h",
58 "public_overrides/bit",
59 "public_overrides/cstddef",
60 "public_overrides/iterator",
61 "public_overrides/type_traits",
62 "public_overrides/utility",
64 sources = [ "language_features.h" ]
67 config("standard_library_public") {
68 include_dirs = [ "standard_library_public" ]
71 pw_source_set("standard_library") {
72 public_configs = [ ":standard_library_public" ]
73 remove_public_deps = [ "*" ]
75 "standard_library_public/pw_polyfill/standard_library/array.h",
76 "standard_library_public/pw_polyfill/standard_library/assert.h",
77 "standard_library_public/pw_polyfill/standard_library/bit.h",
78 "standard_library_public/pw_polyfill/standard_library/cstddef.h",
79 "standard_library_public/pw_polyfill/standard_library/iterator.h",
80 "standard_library_public/pw_polyfill/standard_library/namespace.h",
81 "standard_library_public/pw_polyfill/standard_library/type_traits.h",
82 "standard_library_public/pw_polyfill/standard_library/utility.h",
90 pw_test_group("tests") {
96 group_deps = [ "$dir_pw_span:tests" ]
99 pw_test("default_cpp_test") {
100 deps = [ ":pw_polyfill" ]
101 sources = [ "test.cc" ]
104 pw_test("cpp11_test") {
105 remove_configs = [ "$dir_pw_build:cpp17" ]
106 configs = [ "$dir_pw_build:cpp11" ]
107 sources = [ "test.cc" ]
108 deps = [ ":pw_polyfill" ]
111 pw_test("cpp14_test") {
112 remove_configs = [ "$dir_pw_build:cpp17" ]
113 configs = [ "$dir_pw_build:cpp14" ]
114 sources = [ "test.cc" ]
115 deps = [ ":pw_polyfill" ]
118 pw_doc_group("docs") {
119 sources = [ "docs.rst" ]