1# Copyright 2024 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/module_config.gni") 18import("$dir_pw_build/target_types.gni") 19import("$dir_pw_docgen/docs.gni") 20import("$dir_pw_protobuf_compiler/proto.gni") 21import("$dir_pw_unit_test/test.gni") 22 23declare_args() { 24 # The build target that overrides the default configuration options for this 25 # module. This should point to a source set that provides defines through a 26 # public config (which may -include a file or add defines directly). 27 pw_cpu_exception_risc_v_CONFIG = pw_build_DEFAULT_MODULE_CONFIG 28} 29 30pw_source_set("config") { 31 public_deps = [ pw_cpu_exception_risc_v_CONFIG ] 32 public = [ "pw_cpu_exception_risc_v_private/config.h" ] 33 visibility = [ ":*" ] 34} 35 36config("public_include_path") { 37 include_dirs = [ "public" ] 38 visibility = [ ":*" ] 39} 40 41pw_source_set("support") { 42 deps = [ 43 ":config", 44 "$dir_pw_cpu_exception:support.facade", 45 "$dir_pw_preprocessor:arch", 46 dir_pw_log, 47 dir_pw_span, 48 dir_pw_string, 49 ] 50 sources = [ "support.cc" ] 51} 52 53pw_source_set("proto_dump") { 54 public_configs = [ ":public_include_path" ] 55 public_deps = [ 56 ":cpu_state", 57 dir_pw_protobuf, 58 dir_pw_status, 59 dir_pw_stream, 60 ] 61 public = [ "public/pw_cpu_exception_risc_v/proto_dump.h" ] 62 deps = [ 63 ":config", 64 ":cpu_state_protos.pwpb", 65 ] 66 sources = [ "proto_dump.cc" ] 67} 68 69pw_proto_library("cpu_state_protos") { 70 sources = [ "pw_cpu_exception_risc_v_protos/cpu_state.proto" ] 71} 72 73pw_source_set("cpu_state") { 74 public_configs = [ ":public_include_path" ] 75 public = [ "public/pw_cpu_exception_risc_v/cpu_state.h" ] 76} 77 78pw_source_set("snapshot") { 79 public_configs = [ ":public_include_path" ] 80 public_deps = [ 81 ":cpu_state", 82 ":cpu_state_protos.pwpb", 83 "$dir_pw_thread:protos.pwpb", 84 "$dir_pw_thread:snapshot", 85 dir_pw_protobuf, 86 dir_pw_status, 87 ] 88 public = [ "public/pw_cpu_exception_risc_v/snapshot.h" ] 89 sources = [ "snapshot.cc" ] 90 deps = [ 91 ":config", 92 ":proto_dump", 93 dir_pw_log, 94 ] 95} 96 97pw_test_group("tests") { 98 tests = [] 99} 100 101pw_doc_group("docs") { 102 sources = [ "docs.rst" ] 103} 104