Keir Mierle | af5e358 | 2019-12-30 13:11:05 -0800 | [diff] [blame] | 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 | |
Armando Montanez | fb3d3fb | 2020-06-09 18:12:12 -0700 | [diff] [blame] | 15 | import("//build_overrides/pigweed.gni") |
| 16 | |
Armando Montanez | f1f4110 | 2020-11-02 15:58:39 -0800 | [diff] [blame] | 17 | import("$dir_pw_build/module_config.gni") |
Alexei Frolov | edd2f14 | 2020-06-09 19:11:27 -0700 | [diff] [blame] | 18 | import("$dir_pw_build/target_types.gni") |
Armando Montanez | 0054a9b | 2020-03-13 13:06:24 -0700 | [diff] [blame] | 19 | import("$dir_pw_docgen/docs.gni") |
Wyatt Hepler | d49f8fe | 2020-10-15 10:13:47 -0700 | [diff] [blame] | 20 | |
Armando Montanez | f1f4110 | 2020-11-02 15:58:39 -0800 | [diff] [blame] | 21 | declare_args() { |
| 22 | # The build target that overrides the default configuration options for this |
| 23 | # module. This should point to a source set that provides defines through a |
| 24 | # public config (which may -include a file or add defines directly). |
| 25 | pw_log_basic_CONFIG = pw_build_DEFAULT_MODULE_CONFIG |
| 26 | } |
| 27 | |
Ewout van Bekkum | eac9440 | 2021-05-07 16:58:42 -0700 | [diff] [blame] | 28 | config("public_include_path") { |
Keir Mierle | af5e358 | 2019-12-30 13:11:05 -0800 | [diff] [blame] | 29 | include_dirs = [ "public" ] |
| 30 | } |
| 31 | |
| 32 | config("backend_config") { |
| 33 | include_dirs = [ "public_overrides" ] |
| 34 | } |
| 35 | |
Ewout van Bekkum | eac9440 | 2021-05-07 16:58:42 -0700 | [diff] [blame] | 36 | # pw_log_basic only provides the backend's interface. The implementation is |
| 37 | # pulled in through pw_build_LINK_DEPS. |
Alexei Frolov | 4c0428a | 2020-06-10 10:46:04 -0700 | [diff] [blame] | 38 | pw_source_set("pw_log_basic") { |
| 39 | public_configs = [ |
| 40 | ":backend_config", |
Ewout van Bekkum | eac9440 | 2021-05-07 16:58:42 -0700 | [diff] [blame] | 41 | ":public_include_path", |
Alexei Frolov | 4c0428a | 2020-06-10 10:46:04 -0700 | [diff] [blame] | 42 | ] |
Ewout van Bekkum | eac9440 | 2021-05-07 16:58:42 -0700 | [diff] [blame] | 43 | public = [ |
| 44 | "public/pw_log_basic/log_basic.h", |
| 45 | "public_overrides/pw_log_backend/log_backend.h", |
| 46 | ] |
Wyatt Hepler | ecdcf58 | 2020-05-04 09:43:20 -0700 | [diff] [blame] | 47 | public_deps = [ dir_pw_preprocessor ] |
Ewout van Bekkum | 38f20f7 | 2021-05-12 13:18:22 -0700 | [diff] [blame] | 48 | } |
Ewout van Bekkum | eac9440 | 2021-05-07 16:58:42 -0700 | [diff] [blame] | 49 | |
Ewout van Bekkum | 38f20f7 | 2021-05-12 13:18:22 -0700 | [diff] [blame] | 50 | # The log backend deps that might cause circular dependencies, since |
| 51 | # pw_log is so ubiquitous. These deps are kept separate so they can be |
| 52 | # depended on from elsewhere. |
| 53 | pw_source_set("pw_log_basic.impl") { |
Keir Mierle | af5e358 | 2019-12-30 13:11:05 -0800 | [diff] [blame] | 54 | deps = [ |
Ewout van Bekkum | 38f20f7 | 2021-05-12 13:18:22 -0700 | [diff] [blame] | 55 | ":pw_log_basic", |
Keir Mierle | af5e358 | 2019-12-30 13:11:05 -0800 | [diff] [blame] | 56 | "$dir_pw_log:facade", |
Wyatt Hepler | ecdcf58 | 2020-05-04 09:43:20 -0700 | [diff] [blame] | 57 | dir_pw_string, |
| 58 | dir_pw_sys_io, |
Armando Montanez | f1f4110 | 2020-11-02 15:58:39 -0800 | [diff] [blame] | 59 | pw_log_basic_CONFIG, |
Keir Mierle | af5e358 | 2019-12-30 13:11:05 -0800 | [diff] [blame] | 60 | ] |
Armando Montanez | a1065b9 | 2020-03-19 12:36:31 -0700 | [diff] [blame] | 61 | |
| 62 | # Use emoji log levels if they've been enabled. |
| 63 | _use_emoji = getenv("PW_EMOJI") |
| 64 | defines = [] |
| 65 | if (_use_emoji == "1") { |
| 66 | defines += [ "PW_EMOJI=1" ] |
| 67 | } |
| 68 | |
Armando Montanez | f1f4110 | 2020-11-02 15:58:39 -0800 | [diff] [blame] | 69 | sources = [ |
| 70 | "log_basic.cc", |
| 71 | "pw_log_basic_private/config.h", |
| 72 | ] |
Keir Mierle | af5e358 | 2019-12-30 13:11:05 -0800 | [diff] [blame] | 73 | } |
Armando Montanez | 0054a9b | 2020-03-13 13:06:24 -0700 | [diff] [blame] | 74 | |
| 75 | pw_doc_group("docs") { |
| 76 | sources = [ "docs.rst" ] |
| 77 | } |