diff options
Diffstat (limited to 'BUILD.bazel')
-rw-r--r-- | BUILD.bazel | 47 |
1 files changed, 40 insertions, 7 deletions
diff --git a/BUILD.bazel b/BUILD.bazel index a4423740..41a09857 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -1,4 +1,4 @@ -# Copyright 2017 Google Inc. +# Copyright 2017 Google Inc. # All Rights Reserved. # # @@ -37,11 +37,21 @@ package(default_visibility = ["//visibility:public"]) licenses(["notice"]) config_setting( - name = "win", + name = "windows", + values = {"cpu": "x64_windows"}, +) + +config_setting( + name = "windows_msvc", values = {"cpu": "x64_windows_msvc"}, ) -# Google Test including Google Mock +config_setting( + name = "has_absl", + values = {"define": "absl=1"}, +) + +# Google Test including Google Mock cc_library( name = "gtest", srcs = glob( @@ -59,16 +69,25 @@ cc_library( "googlemock/src/gmock_main.cc", ], ), - hdrs =glob([ + hdrs = glob([ "googletest/include/gtest/*.h", "googlemock/include/gmock/*.h", ]), copts = select( { - ":win": [], + ":windows": [], + ":windows_msvc": [], "//conditions:default": ["-pthread"], }, ), + defines = select( + { + ":has_absl": [ + "GTEST_HAS_ABSL=1", + ], + "//conditions:default": [], + }, + ), includes = [ "googlemock", "googlemock/include", @@ -76,11 +95,25 @@ cc_library( "googletest/include", ], linkopts = select({ - ":win": [], + ":windows": [], + ":windows_msvc": [], "//conditions:default": [ "-pthread", ], }), + deps = select( + { + ":has_absl": [ + "@com_google_absl//absl/debugging:failure_signal_handler", + "@com_google_absl//absl/debugging:stacktrace", + "@com_google_absl//absl/debugging:symbolize", + "@com_google_absl//absl/strings", + "@com_google_absl//absl/types:optional", + "@com_google_absl//absl/types:variant", + ], + "//conditions:default": [], + }, + ), ) cc_library( @@ -88,7 +121,7 @@ cc_library( srcs = [ "googlemock/src/gmock_main.cc", ], - deps = ["//:gtest"], + deps = [":gtest"], ) # The following rules build samples of how to use gTest. |