-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add an example using glog from Bazel
- Loading branch information
Showing
3 changed files
with
25 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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", | ||
], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |