Skip to content

Commit

Permalink
Add an example using glog from Bazel
Browse files Browse the repository at this point in the history
  • Loading branch information
drigz committed Dec 19, 2017
1 parent fc87161 commit 9347949
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
4 changes: 3 additions & 1 deletion WORKSPACE
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
workspace(name = "com_google_glog")

git_repository(
name = "com_github_gflags_gflags",
remote = "https://github.com/gflags/gflags.git",
tag = 'v2.2.1',
tag = "v2.2.1",
)
8 changes: 8 additions & 0 deletions bazel/example/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
cc_test(
name = "main",
size = "small",
srcs = ["main.cc"],
deps = [
"@com_google_glog//:glog",
],
)
14 changes: 14 additions & 0 deletions bazel/example/main.cc
Original file line number Diff line number Diff line change
@@ -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;
}

0 comments on commit 9347949

Please sign in to comment.