Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an example using glog from Bazel #276

Merged
merged 1 commit into from
Jan 4, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 = [
"//: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;
}