From 3efe9e402532411b1271acfc8b1cf6186db119fa Mon Sep 17 00:00:00 2001 From: Rodrigo Queiro Date: Tue, 19 Dec 2017 15:42:59 +0100 Subject: [PATCH] Add an example using glog from Bazel --- bazel/example/BUILD | 8 ++++++++ bazel/example/main.cc | 14 ++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 bazel/example/BUILD create mode 100644 bazel/example/main.cc diff --git a/bazel/example/BUILD b/bazel/example/BUILD new file mode 100644 index 000000000..6b10e2b2f --- /dev/null +++ b/bazel/example/BUILD @@ -0,0 +1,8 @@ +cc_test( + name = "main", + size = "small", + srcs = ["main.cc"], + deps = [ + "//:glog", + ], +) diff --git a/bazel/example/main.cc b/bazel/example/main.cc new file mode 100644 index 000000000..da5c020d6 --- /dev/null +++ b/bazel/example/main.cc @@ -0,0 +1,14 @@ +#include +#include + +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; +}