|
| 1 | +# Adapted from https://github.com/mzhaom/trunk/blob/master/third_party/gtest/BUILD |
| 2 | +licenses(["notice"]) |
| 3 | + |
1 | 4 | cc_library( |
2 | | - name = "main", |
3 | | - srcs = glob( |
4 | | - ["src/*.cc"], |
5 | | - exclude = ["src/gtest-all.cc"], |
6 | | - ), |
7 | | - hdrs = glob([ |
8 | | - "include/**/*.h", |
9 | | - "src/*.h", |
10 | | - ]), |
11 | | - copts = ["-Iexternal/gtest/include"], |
12 | | - linkopts = ["-pthread"], |
| 5 | + name = "gtest", |
| 6 | + testonly = 1, |
13 | 7 | visibility = ["//visibility:public"], |
| 8 | + includes = [ |
| 9 | + "googletest/include", |
| 10 | + ], |
| 11 | + hdrs = [ |
| 12 | + "googletest/include/gtest/gtest-death-test.h", |
| 13 | + "googletest/include/gtest/gtest-message.h", |
| 14 | + "googletest/include/gtest/gtest_pred_impl.h", |
| 15 | + "googletest/include/gtest/gtest-test-part.h", |
| 16 | + "googletest/include/gtest/gtest.h", |
| 17 | + "googletest/include/gtest/gtest-param-test.h", |
| 18 | + "googletest/include/gtest/gtest-printers.h", |
| 19 | + "googletest/include/gtest/gtest-spi.h", |
| 20 | + "googletest/include/gtest/gtest-typed-test.h" |
| 21 | + ], |
| 22 | + srcs = glob([ |
| 23 | + "googletest/include/gtest/internal/**/*.h" |
| 24 | + ]) + [ |
| 25 | + "googletest/src/gtest-internal-inl.h", |
| 26 | + "googletest/src/gtest-death-test.cc", |
| 27 | + "googletest/src/gtest-filepath.cc", |
| 28 | + "googletest/src/gtest-port.cc", |
| 29 | + "googletest/src/gtest-printers.cc", |
| 30 | + "googletest/src/gtest-test-part.cc", |
| 31 | + "googletest/src/gtest-typed-test.cc", |
| 32 | + "googletest/src/gtest.cc", |
| 33 | + ], |
| 34 | + copts = [ |
| 35 | + "-Iexternal/gtest/googletest" |
| 36 | + ], |
| 37 | + deps = [ |
| 38 | + ":gtest_prod", |
| 39 | + ], |
| 40 | +) |
| 41 | + |
| 42 | +cc_library( |
| 43 | + name = "gtest_main", |
| 44 | + testonly = 1, |
| 45 | + visibility = ["//visibility:public"], |
| 46 | + deps = [ |
| 47 | + ":gtest", |
| 48 | + ], |
| 49 | + srcs = [ |
| 50 | + "googletest/src/gtest_main.cc", |
| 51 | + ], |
| 52 | +) |
| 53 | + |
| 54 | +cc_library( |
| 55 | + name = "gtest_prod", |
| 56 | + visibility = ["//visibility:public"], |
| 57 | + hdrs = [ |
| 58 | + "googletest/include/gtest/gtest_prod.h", |
| 59 | + ], |
| 60 | +) |
| 61 | + |
| 62 | +cc_library( |
| 63 | + name = "googlemock", |
| 64 | + testonly = 1, |
| 65 | + visibility = ["//visibility:public"], |
| 66 | + hdrs = [ |
| 67 | + "googlemock/include/gmock/gmock-actions.h", |
| 68 | + "googlemock/include/gmock/gmock-cardinalities.h", |
| 69 | + "googlemock/include/gmock/gmock-generated-actions.h", |
| 70 | + "googlemock/include/gmock/gmock-generated-function-mockers.h", |
| 71 | + "googlemock/include/gmock/gmock-generated-matchers.h", |
| 72 | + "googlemock/include/gmock/gmock-generated-nice-strict.h", |
| 73 | + "googlemock/include/gmock/gmock.h", |
| 74 | + "googlemock/include/gmock/gmock-matchers.h", |
| 75 | + "googlemock/include/gmock/gmock-more-actions.h", |
| 76 | + "googlemock/include/gmock/gmock-more-matchers.h", |
| 77 | + "googlemock/include/gmock/gmock-spec-builders.h", |
| 78 | + ], |
| 79 | + srcs = glob([ |
| 80 | + "googlemock/include/gmock/internal/**/*.h" |
| 81 | + ]) + [ |
| 82 | + "googlemock/src/gmock-cardinalities.cc", |
| 83 | + "googlemock/src/gmock.cc", |
| 84 | + "googlemock/src/gmock-internal-utils.cc", |
| 85 | + "googlemock/src/gmock-matchers.cc", |
| 86 | + "googlemock/src/gmock-spec-builders.cc", |
| 87 | + ], |
| 88 | + deps = [ |
| 89 | + ":gtest", |
| 90 | + ], |
| 91 | + includes = [ |
| 92 | + "googlemock/include", |
| 93 | + ], |
| 94 | +) |
| 95 | + |
| 96 | +cc_library( |
| 97 | + name = "gmock_main", |
| 98 | + visibility = ["//visibility:public"], |
| 99 | + deps = [ |
| 100 | + ":gmock", |
| 101 | + ], |
| 102 | + srcs = [ |
| 103 | + "googlemock/src/gmock_main.cc", |
| 104 | + ], |
14 | 105 | ) |
0 commit comments