parent
174ca2723a
commit
62a7e5cf01
@ -0,0 +1,8 @@
|
|||||||
|
git_repository(
|
||||||
|
name = "org_pubref_rules_protobuf",
|
||||||
|
remote = "https://github.com/pubref/rules_protobuf",
|
||||||
|
tag = "v0.7.1",
|
||||||
|
)
|
||||||
|
|
||||||
|
load("@org_pubref_rules_protobuf//cpp:rules.bzl", "cpp_proto_repositories")
|
||||||
|
cpp_proto_repositories()
|
@ -0,0 +1,17 @@
|
|||||||
|
licenses(["notice"]) # Apache 2.0
|
||||||
|
|
||||||
|
load("@org_pubref_rules_protobuf//cpp:rules.bzl", "cpp_proto_library")
|
||||||
|
|
||||||
|
cpp_proto_library(
|
||||||
|
name = "example_proto",
|
||||||
|
protos = [
|
||||||
|
"example.proto"
|
||||||
|
],
|
||||||
|
)
|
||||||
|
|
||||||
|
cc_library(
|
||||||
|
name = "example_lib",
|
||||||
|
srcs = ["example_lib.cc"],
|
||||||
|
hdrs = ["example_lib.h"],
|
||||||
|
deps = [":example_proto"],
|
||||||
|
)
|
@ -0,0 +1 @@
|
|||||||
|
This package tests that Bazel can build protobuf related rules.
|
@ -0,0 +1,7 @@
|
|||||||
|
syntax = "proto3";
|
||||||
|
|
||||||
|
package protos;
|
||||||
|
|
||||||
|
message Greeting {
|
||||||
|
string name = 1;
|
||||||
|
}
|
@ -0,0 +1,6 @@
|
|||||||
|
#include "third_party/protobuf_test/example_lib.h"
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
std::string get_greet(const ::protos::Greeting& who) {
|
||||||
|
return "Hello " + who.name();
|
||||||
|
}
|
@ -0,0 +1,7 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "third_party/protobuf_test/example.pb.h"
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
std::string get_greet(const ::protos::Greeting &who);
|
Loading…
Reference in new issue