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/facade.gni") 18import("$dir_pw_build/target_types.gni") 19import("$dir_pw_docgen/docs.gni") 20import("backend.gni") 21 22config("public_include_path") { 23 include_dirs = [ "public" ] 24 visibility = [ ":*" ] 25} 26 27config("backend_config") { 28 include_dirs = [ "public_overrides" ] 29 visibility = [ ":*" ] 30} 31 32pw_facade("handler") { 33 backend = pw_assert_basic_HANDLER_BACKEND 34 public_configs = [ ":public_include_path" ] 35 public_deps = [ "$dir_pw_preprocessor" ] 36 public = [ "public/pw_assert_basic/handler.h" ] 37} 38 39# pw_assert_basic only provides the backend's interface. The implementation is 40# pulled in through pw_build_LINK_DEPS. 41pw_source_set("pw_assert_basic") { 42 public_configs = [ 43 ":backend_config", 44 ":public_include_path", 45 ] 46 public = [ 47 "public/pw_assert_basic/assert_basic.h", 48 "public/pw_assert_basic/handler.h", 49 "public_overrides/pw_assert_backend/assert_backend.h", 50 ] 51} 52 53# The assert backend deps that might cause circular dependencies, since 54# pw_assert is so ubiquitous. These deps are kept separate so they can be 55# depended on from elsewhere. 56pw_source_set("pw_assert_basic.impl") { 57 public_deps = [ 58 dir_pw_result, 59 dir_pw_string, 60 dir_pw_sys_io, 61 ] 62 deps = [ 63 ":pw_assert_basic", 64 "$dir_pw_assert:config", 65 "$dir_pw_assert:facade", 66 "$dir_pw_preprocessor", 67 pw_assert_basic_HANDLER_BACKEND, 68 ] 69 sources = [ "assert_basic.cc" ] 70} 71 72# A basic handler backend using pw_sys_io. 73pw_source_set("basic_handler") { 74 # Turn off GN check since this target intentionally leaves out deps to avoid 75 # circular dependencies. 76 check_includes = false 77 78 # Depend on the include path instead of the library to avoid circular deps. 79 configs = [ 80 "$dir_pw_string:public_include_path", 81 "$dir_pw_result:public_include_path", 82 ] 83 deps = [ 84 ":handler.facade", 85 "$dir_pw_assert:config", 86 "$dir_pw_assert:facade", 87 "$dir_pw_preprocessor", 88 "$dir_pw_sys_io:facade", # Only pull in the facade to avoid circular deps 89 dir_pw_status, 90 ] 91 sources = [ "basic_handler.cc" ] 92} 93 94pw_doc_group("docs") { 95 sources = [ "docs.rst" ] 96} 97