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 ":minimal_cpp_stdlib_test", 75 ":standard_library_test", 76 ] 77} 78 79pw_source_set("minimal_cpp_stdlib_isolated_test") { 80 configs = [ ":no_cpp_includes" ] 81 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" ] 91 sources = [ "test.cc" ] 92} 93 94pw_test("standard_library_test") { 95 sources = [ 96 "isolated_test.cc", 97 "test.cc", 98 ] 99} 100 101pw_doc_group("docs") { 102 sources = [ "docs.rst" ] 103} 104