Add an example using glog from Bazel
This commit is contained in:
parent
bffb4a6ee2
commit
3efe9e4025
8
bazel/example/BUILD
Normal file
8
bazel/example/BUILD
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
cc_test(
|
||||||
|
name = "main",
|
||||||
|
size = "small",
|
||||||
|
srcs = ["main.cc"],
|
||||||
|
deps = [
|
||||||
|
"//:glog",
|
||||||
|
],
|
||||||
|
)
|
||||||
14
bazel/example/main.cc
Normal file
14
bazel/example/main.cc
Normal 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;
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user