| # Copyright (C) 2017 The Android Open Source Project |
| # |
| # 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 |
| # |
| # http://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("../../gn/perfetto.gni") |
| import("../../src/protozero/protozero_library.gni") |
| import("all_protos.gni") |
| |
| # Create a copy of all the protos listed in all_protos.gni with the |
| # "option optimize_for = LITE_RUNTIME" bit removed so we can generate |
| # full proto .h/.cc files. |
| full_protos_base_dir = "${root_gen_dir}/protos_full" |
| full_protos_target_dir = |
| "$full_protos_base_dir/" + rebase_path(target_gen_dir, root_gen_dir) |
| |
| action_foreach("generate_full_protos") { |
| visibility = [ ":*" ] |
| script = "generate_full_protos.py" |
| sources = ftrace_proto_names |
| |
| # TODO(hjd): Add support for subdirectories. |
| output_directory = full_protos_target_dir |
| outputs = [ |
| "$output_directory/{{source_name_part}}.proto", |
| ] |
| |
| args = [ |
| "{{source}}", |
| rebase_path(output_directory, root_build_dir) + |
| "/{{source_name_part}}.proto", |
| ] |
| } |
| |
| proto_library("full") { |
| testonly = true |
| deps = [ |
| ":generate_full_protos", |
| ] |
| sources = [] |
| use_protobuf_full = true |
| proto_in_dir = "$full_protos_base_dir/" + perfetto_root_path |
| proto_out_dir = "protos_full" |
| foreach(proto, ftrace_proto_names) { |
| sources += [ "$full_protos_target_dir/$proto" ] |
| } |
| } |
| |
| proto_library("lite") { |
| sources = ftrace_proto_names |
| proto_in_dir = perfetto_root_path |
| proto_out_dir = "protos_lite" |
| } |
| |
| protozero_library("zero") { |
| sources = ftrace_proto_names |
| proto_in_dir = perfetto_root_path |
| proto_out_dir = "protos_zero" |
| generator_plugin_options = "wrapper_namespace=pbzero" |
| } |