浏览代码

Add a proto_lang_toolchain() for cc_proto_library

Bazel's built-in cc_proto_library rule uses a proto_lang_toolchain to learn how to invoke proto-compiler.
To use Bazel's cc_proto_library, add the following to your project's WORKSPACE file:

local_repository(
  name = "com_google_protobuf_cc",
  path = "/path/to/protobuf-distribution/"
)
cgrushko 8 年之前
父节点
当前提交
45d92aea27
共有 1 个文件被更改,包括 7 次插入0 次删除
  1. 7 0
      BUILD

+ 7 - 0
BUILD

@@ -749,3 +749,10 @@ internal_protobuf_py_tests(
     ],
     deps = [":python_tests"],
 )
+
+proto_lang_toolchain(
+  name = "cc_toolchain",
+  runtime = ":protobuf",
+  command_line = "--cpp_out=$(OUT)",
+  visibility = ["//visibility:public"],
+)