• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2020 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
15import("//build_overrides/pigweed.gni")
16
17import("$dir_pw_build/target_types.gni")
18import("$dir_pw_docgen/docs.gni")
19import("$dir_pw_unit_test/test.gni")
20
21config("include_dirs") {
22  include_dirs = [ "public" ]
23}
24
25config("no_cpp_includes") {
26  cflags = [ "-nostdinc++" ]
27}
28
29pw_source_set("pw_minimal_cpp_stdlib") {
30  public_configs = [ ":include_dirs" ]
31  configs = [ ":no_cpp_includes" ]
32  public = [
33    "public/algorithm",
34    "public/array",
35    "public/cinttypes",
36    "public/climits",
37    "public/cmath",
38    "public/cstdarg",
39    "public/cstddef",
40    "public/cstdint",
41    "public/cstdio",
42    "public/cstring",
43    "public/initializer_list",
44    "public/iterator",
45    "public/limits",
46    "public/new",
47    "public/string_view",
48    "public/type_traits",
49    "public/utility",
50  ]
51  sources = [
52    "public/internal/algorithm.h",
53    "public/internal/array.h",
54    "public/internal/cinttypes.h",
55    "public/internal/climits.h",
56    "public/internal/cmath.h",
57    "public/internal/cstdarg.h",
58    "public/internal/cstddef.h",
59    "public/internal/cstdint.h",
60    "public/internal/cstdio.h",
61    "public/internal/cstring.h",
62    "public/internal/initializer_list.h",
63    "public/internal/iterator.h",
64    "public/internal/limits.h",
65    "public/internal/new.h",
66    "public/internal/string_view.h",
67    "public/internal/type_traits.h",
68    "public/internal/utility.h",
69  ]
70}
71
72pw_test_group("tests") {
73  tests = []
74  if (host_os != "win") {
75    # TODO(amontanez): pw_minimal_cpp_stdlib tests do not build on windows.
76    tests += [
77      ":minimal_cpp_stdlib_test",
78      ":standard_library_test",
79    ]
80  }
81}
82
83pw_source_set("minimal_cpp_stdlib_isolated_test") {
84  configs = [ ":no_cpp_includes" ]
85  deps = [
86    ":pw_minimal_cpp_stdlib",
87    dir_pw_preprocessor,
88  ]
89  sources = [ "isolated_test.cc" ]
90  visibility = [ ":*" ]
91}
92
93pw_test("minimal_cpp_stdlib_test") {
94  deps = [ ":minimal_cpp_stdlib_isolated_test" ]
95  sources = [ "test.cc" ]
96}
97
98pw_test("standard_library_test") {
99  sources = [
100    "isolated_test.cc",
101    "test.cc",
102  ]
103}
104
105pw_doc_group("docs") {
106  sources = [ "docs.rst" ]
107}
108