Merge pull request #276 from drigz/add-example

Add an example using glog from Bazel
This commit is contained in:
Rodrigo Queiro 2018-01-04 12:00:27 +01:00 committed by GitHub
commit 5b1aa94e4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 0 deletions

8
bazel/example/BUILD Normal file
View File

@ -0,0 +1,8 @@
cc_test(
name = "main",
size = "small",
srcs = ["main.cc"],
deps = [
"//:glog",
],
)

14
bazel/example/main.cc Normal file
View File

@ -0,0 +1,14 @@
#include <gflags/gflags.h>
#include <glog/logging.h>
int main(int argc, char* argv[]) {
// Initialize Google's logging library.
google::InitGoogleLogging(argv[0]);
// Optional: parse command line flags
gflags::ParseCommandLineFlags(&argc, &argv, true);
LOG(INFO) << "Hello, world!";
return 0;
}