blob: 332e18c5cf1aeabb8987404242bfac44c51581f8 [file] [log] [blame]
Wyatt Hepler0412a7d2020-01-28 16:27:32 -08001# 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
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 Hepler0412a7d2020-01-28 16:27:32 -080018import("$dir_pw_docgen/docs.gni")
19import("$dir_pw_unit_test/test.gni")
Wyatt Heplerd49f8fe2020-10-15 10:13:47 -070020
Wyatt Hepler0412a7d2020-01-28 16:27:32 -080021config("include_dirs") {
22 include_dirs = [ "public" ]
23}
24
25config("no_cpp_includes") {
26 cflags = [ "-nostdinc++" ]
27}
28
Alexei Frolovedd2f142020-06-09 19:11:27 -070029pw_source_set("pw_minimal_cpp_stdlib") {
Wyatt Hepler0412a7d2020-01-28 16:27:32 -080030 public_configs = [ ":include_dirs" ]
31 configs = [ ":no_cpp_includes" ]
32 public = [
33 "public/algorithm",
34 "public/array",
35 "public/cinttypes",
Armando Montanez187389d2020-04-06 17:00:13 -070036 "public/climits",
Wyatt Hepler0412a7d2020-01-28 16:27:32 -080037 "public/cmath",
38 "public/cstdarg",
39 "public/cstddef",
40 "public/cstdint",
41 "public/cstdio",
42 "public/cstring",
Wyatt Hepler1c9ce1b2020-01-31 17:34:38 -080043 "public/initializer_list",
Wyatt Hepler0412a7d2020-01-28 16:27:32 -080044 "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",
Armando Montanez187389d2020-04-06 17:00:13 -070055 "public/internal/climits.h",
Wyatt Hepler0412a7d2020-01-28 16:27:32 -080056 "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",
Wyatt Hepler1c9ce1b2020-01-31 17:34:38 -080062 "public/internal/initializer_list.h",
Wyatt Hepler0412a7d2020-01-28 16:27:32 -080063 "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 ":minimal_cpp_stdlib_test",
75 ":standard_library_test",
76 ]
77}
78
Wyatt Hepler023f35b2020-07-01 09:40:50 -070079pw_source_set("minimal_cpp_stdlib_isolated_test") {
Wyatt Hepler0412a7d2020-01-28 16:27:32 -080080 configs = [ ":no_cpp_includes" ]
Wyatt Hepler023f35b2020-07-01 09:40:50 -070081 deps = [
82 ":pw_minimal_cpp_stdlib",
83 dir_pw_preprocessor,
84 ]
85 sources = [ "isolated_test.cc" ]
86 visibility = [ ":*" ]
87}
88
89pw_test("minimal_cpp_stdlib_test") {
90 deps = [ ":minimal_cpp_stdlib_isolated_test" ]
Rob Mohra0ba54f2020-02-27 11:43:49 -080091 sources = [ "test.cc" ]
Wyatt Hepler0412a7d2020-01-28 16:27:32 -080092}
93
94pw_test("standard_library_test") {
Wyatt Hepler023f35b2020-07-01 09:40:50 -070095 sources = [
96 "isolated_test.cc",
97 "test.cc",
98 ]
Wyatt Hepler0412a7d2020-01-28 16:27:32 -080099}
100
101pw_doc_group("docs") {
Rob Mohra0ba54f2020-02-27 11:43:49 -0800102 sources = [ "docs.rst" ]
Wyatt Hepler0412a7d2020-01-28 16:27:32 -0800103}