提交 62a7e5cf 编写于 作者: Y Yi Wang

Initialize Bazel WORKSPACE and a testing packages

上级 174ca272
......@@ -9,3 +9,6 @@ build/
.pydevproject
Makefile
.test_env/
*~
bazel-*
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()
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"],
)
This package tests that Bazel can build protobuf related rules.
syntax = "proto3";
package protos;
message Greeting {
string name = 1;
}
#include "third_party/protobuf_test/example_lib.h"
#include <string>
std::string get_greet(const ::protos::Greeting& who) {
return "Hello " + who.name();
}
#pragma once
#include "third_party/protobuf_test/example.pb.h"
#include <string>
std::string get_greet(const ::protos::Greeting &who);
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册