diff options
author | Derek Mauro <dmauro@google.com> | 2022-04-04 07:38:23 -0700 |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2022-04-04 07:39:03 -0700 |
commit | 25dcdc7e8bfac8967f20fb2c0a628f5cf442188d (patch) | |
tree | 0bd2bf078f5491dfd089dc0fab194b805788d622 /BUILD.bazel | |
parent | af29db7ec28d6df1c7f0f745186884091e602e07 (diff) | |
download | googletest-25dcdc7e8bfac8967f20fb2c0a628f5cf442188d.zip googletest-25dcdc7e8bfac8967f20fb2c0a628f5cf442188d.tar.gz googletest-25dcdc7e8bfac8967f20fb2c0a628f5cf442188d.tar.bz2 |
Use the Abseil flags library when Abseil is present
When built with `--define=absl=1` under Bazel, GoogleTest
flags use ABSL_FLAG instead of GoogleTest's own implementation.
There are some minor behavior differences in this mode.
The most notable difference is that unrecognized flags result
in a flag parsing error, and are not returned to the user though
a modified argc/argv, unless they appear after the positional
argument delimiter ("--").
For example, to pass a non-Abseil flag, you would have to do
./mytest --gtest_color=false -- --myflag=myvalue
The documentation at https://abseil.io/docs/cpp/guides/flags
may be helpful in understanding the behavior.
There are some other minor differences. For example,
passing --help results in the program returning 1 instead of 0.
https://github.com/google/googletest/issues/3646
PiperOrigin-RevId: 439312700
Change-Id: Id696a25f50f24a5b1785c45ca8fa59794f86fd5c
Diffstat (limited to 'BUILD.bazel')
-rw-r--r-- | BUILD.bazel | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/BUILD.bazel b/BUILD.bazel index 1df5ff5..192f18e 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -120,8 +120,14 @@ cc_library( linkopts = select({ ":qnx": ["-lregex"], ":windows": [], - ":freebsd": ["-lm", "-pthread"], - ":openbsd": ["-lm", "-pthread"], + ":freebsd": [ + "-lm", + "-pthread", + ], + ":openbsd": [ + "-lm", + "-pthread", + ], "//conditions:default": ["-pthread"], }), deps = select({ @@ -129,6 +135,10 @@ cc_library( "@com_google_absl//absl/debugging:failure_signal_handler", "@com_google_absl//absl/debugging:stacktrace", "@com_google_absl//absl/debugging:symbolize", + "@com_google_absl//absl/flags:flag", + "@com_google_absl//absl/flags:parse", + "@com_google_absl//absl/flags:reflection", + "@com_google_absl//absl/flags:usage", "@com_google_absl//absl/strings", "@com_google_absl//absl/types:any", "@com_google_absl//absl/types:optional", |