blob: 89e7969fcdb766d95c77ba61da05b96d6008b137 [file] [log] [blame]
Primiano Tucci4f9b6d72017-12-05 20:59:16 +00001# Copyright (C) 2017 The Android Open Source Project
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://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,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
Primiano Tucci4c5efa42018-10-23 13:15:13 +010015import("perfetto.gni")
16import("proto_library.gni")
Primiano Tucci4f9b6d72017-12-05 20:59:16 +000017
18# Equivalent to proto_library (generation of .h/.cc from .proto files) but
19# enables also generation using the protozero plugin.
20# The generated files will have the .pbzero.{cc,h} suffix, as opposed to the
21# .pb.{cc,h} of the official proto library.
22template("protozero_library") {
23 proto_library(target_name) {
24 perfetto_root_path = invoker.perfetto_root_path
25
26 generate_cc = false
Primiano Tucci20b760c2018-01-19 12:36:12 +000027 generate_python = false
Primiano Tucci4f9b6d72017-12-05 20:59:16 +000028 generator_plugin_label = perfetto_root_path + "src/protozero/protoc_plugin"
29 generator_plugin_suffix = ".pbzero"
Oystein Eftevaag589fda42018-07-12 16:00:17 -070030 if (build_with_chromium) {
31 component_build_force_source_set = true
32 }
Primiano Tucci4f9b6d72017-12-05 20:59:16 +000033
34 if (defined(invoker.deps)) {
35 deps = invoker.deps
36 } else {
37 deps = []
38 }
39
40 deps += [ perfetto_root_path + "src/protozero" ]
41
42 forward_variables_from(invoker,
43 [
44 "defines",
45 "generator_plugin_options",
46 "include_dirs",
47 "proto_in_dir",
48 "proto_out_dir",
49 "sources",
50 "testonly",
51 "visibility",
52 ])
53 }
54}