blob: f65e44718f9d80648aebdcb2c9040a95f5cae20b [file] [log] [blame]
# 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("//build/proto_library.gni")
# Equivalent to proto_library (generation of .h/.cc form .proto files) but
# enables also generation using the protozero plugin.
# The generated files will have the .pbzero.{cc,h} suffix, as opposite to the
# .pb.{cc,h} of the official proto library.
template("protozero_library") {
proto_library(target_name) {
generate_cc = false
generator_plugin_label = "//protozero/src/protoc_plugin"
generator_plugin_suffix = ".pbzero"
generator_plugin_options = "wrapper_namespace=pbzero"
public_configs = [ "//protozero:protozero_config" ]
deps = []
if (defined(invoker.deps)) {
deps = invoker.deps
}
deps += [ "//protozero" ]
forward_variables_from(invoker,
[
"defines",
"generator_plugin_options",
"include_dirs",
"proto_in_dir",
"proto_out_dir",
"sources",
"testonly",
"visibility",
])
}
}