| # Copyright 2022 The Pigweed Authors |
| # |
| # Licensed under the Apache License, Version 2.0 (the "License"); you may not |
| # use this file except in compliance with the License. You may obtain a copy of |
| # the License at |
| # |
| # https://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, software |
| # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| # License for the specific language governing permissions and limitations under |
| # the License. |
| |
| import("//build_overrides/pigweed.gni") |
| |
| import("$dir_pw_build/error.gni") |
| import("$dir_pw_build/target_types.gni") |
| import("$dir_pw_docgen/docs.gni") |
| import("backend.gni") |
| |
| config("public_include_path") { |
| include_dirs = [ "public" ] |
| } |
| |
| config("backend_config") { |
| include_dirs = [ "public_overrides" ] |
| } |
| |
| # This source set only provides pw_log_string's backend interface. The implementation is |
| # pulled in through pw_build_LINK_DEPS. |
| pw_source_set("pw_log_string") { |
| public_configs = [ |
| ":backend_config", |
| ":public_include_path", |
| ] |
| public = [ |
| "public/pw_log_string/log_string.h", |
| "public_overrides/pw_log_backend/log_backend.h", |
| ] |
| public_deps = [ dir_pw_preprocessor ] |
| } |
| |
| # The log backend deps that might cause circular dependencies, since |
| # pw_log is so ubiquitous. These deps are kept separate so they can be |
| # depended on from elsewhere. |
| if (pw_log_string_BACKEND != "") { |
| pw_source_set("pw_log_string.impl") { |
| deps = [ pw_log_string_BACKEND ] |
| } |
| } else { |
| pw_error("pw_log_string.impl") { |
| message = string_join( |
| " ", |
| [ |
| "To use pw_log_string, please direct pw_log_string_BACKEND", |
| "to the source set that implements the C API.", |
| ]) |
| } |
| } |
| |
| pw_doc_group("docs") { |
| sources = [ "docs.rst" ] |
| } |