1# Copyright (C) 2018. Huawei Technologies Co., Ltd. All rights reserved. 2# Use of this source code is governed by a BSD-style license that can be 3# found in the LICENSE file. 4 5config("gtest_private_config") { 6 visibility = [ ":*" ] 7 include_dirs = [ "googletest" ] 8} 9 10config("gtest_config") { 11 include_dirs = [ "googletest/include" ] 12 if (is_mingw) { 13 cflags_cc = [ 14 "-Wno-unused-const-variable", 15 "-Wno-unused-private-field", 16 ] 17 } 18} 19 20static_library("gtest") { 21 testonly = true 22 public = [ 23 "googletest/include/gtest/gtest-spi.h", 24 "googletest/include/gtest/gtest.h", 25 ] 26 sources = [ 27 "googletest/include/gtest/gtest-death-test.h", 28 "googletest/include/gtest/gtest-matchers.h", 29 "googletest/include/gtest/gtest-message.h", 30 "googletest/include/gtest/gtest-param-test.h", 31 "googletest/include/gtest/gtest-printers.h", 32 "googletest/include/gtest/gtest-test-part.h", 33 "googletest/include/gtest/gtest-typed-test.h", 34 "googletest/include/gtest/gtest_pred_impl.h", 35 "googletest/include/gtest/gtest_prod.h", 36 "googletest/include/gtest/hwext/gtest-ext.h", 37 "googletest/include/gtest/hwext/gtest-filter.h", 38 "googletest/include/gtest/hwext/gtest-tag.h", 39 "googletest/include/gtest/hwext/utils.h", 40 "googletest/include/gtest/internal/custom/gtest-port.h", 41 "googletest/include/gtest/internal/custom/gtest-printers.h", 42 "googletest/include/gtest/internal/custom/gtest.h", 43 "googletest/include/gtest/internal/gtest-death-test-internal.h", 44 "googletest/include/gtest/internal/gtest-filepath.h", 45 "googletest/include/gtest/internal/gtest-internal.h", 46 "googletest/include/gtest/internal/gtest-param-util.h", 47 "googletest/include/gtest/internal/gtest-port-arch.h", 48 "googletest/include/gtest/internal/gtest-port.h", 49 "googletest/include/gtest/internal/gtest-string.h", 50 "googletest/include/gtest/internal/gtest-type-util.h", 51 "googletest/src/gtest-all.cc", 52 "googletest/src/gtest-death-test.cc", 53 "googletest/src/gtest-filepath.cc", 54 "googletest/src/gtest-internal-inl.h", 55 "googletest/src/gtest-matchers.cc", 56 "googletest/src/gtest-port.cc", 57 "googletest/src/gtest-printers.cc", 58 "googletest/src/gtest-test-part.cc", 59 "googletest/src/gtest-typed-test.cc", 60 "googletest/src/gtest.cc", 61 "googletest/src/hwext/gtest-ext.cc", 62 "googletest/src/hwext/gtest-filter.cc", 63 "googletest/src/hwext/gtest-tag.cc", 64 "googletest/src/hwext/gtest-utils.cc", 65 ] 66 sources -= [ "googletest/src/gtest-all.cc" ] 67 public_configs = [ ":gtest_config" ] 68 configs += [ ":gtest_private_config" ] 69 configs -= [ "//build/config/coverage:default_coverage" ] 70} 71 72static_library("gtest_main") { 73 testonly = true 74 sources = [ "googletest/src/gtest_main.cc" ] 75 public_deps = [ ":gtest" ] 76 configs -= [ "//build/config/coverage:default_coverage" ] 77} 78 79config("gmock_private_config") { 80 visibility = [ ":*" ] 81 include_dirs = [ "googlemock" ] 82} 83 84config("gmock_config") { 85 include_dirs = [ "googlemock/include" ] 86 87 cflags_cc = [ 88 # The MOCK_METHODn() macros do not specify "override", which triggers this 89 # warning in users: "error: 'Method' overrides a member function but is not 90 # marked 'override' [-Werror,-Winconsistent-missing-override]". Suppress 91 # these warnings until https://github.com/google/googletest/issues/533 is 92 # fixed. 93 "-Wno-inconsistent-missing-override", 94 ] 95} 96 97static_library("gmock") { 98 testonly = true 99 public = [ "googlemock/include/gmock/gmock.h" ] 100 sources = [ 101 "googlemock/include/gmock/gmock-actions.h", 102 "googlemock/include/gmock/gmock-cardinalities.h", 103 "googlemock/include/gmock/gmock-function-mocker.h", 104 "googlemock/include/gmock/gmock-matchers.h", 105 "googlemock/include/gmock/gmock-more-actions.h", 106 "googlemock/include/gmock/gmock-more-matchers.h", 107 "googlemock/include/gmock/gmock-nice-strict.h", 108 "googlemock/include/gmock/gmock-spec-builders.h", 109 "googlemock/include/gmock/internal/custom/gmock-generated-actions.h", 110 "googlemock/include/gmock/internal/custom/gmock-matchers.h", 111 "googlemock/include/gmock/internal/custom/gmock-port.h", 112 "googlemock/include/gmock/internal/gmock-internal-utils.h", 113 "googlemock/include/gmock/internal/gmock-port.h", 114 "googlemock/include/gmock/internal/gmock-pp.h", 115 "googlemock/src/gmock-all.cc", 116 "googlemock/src/gmock-cardinalities.cc", 117 "googlemock/src/gmock-internal-utils.cc", 118 "googlemock/src/gmock-matchers.cc", 119 "googlemock/src/gmock-spec-builders.cc", 120 "googlemock/src/gmock.cc", 121 ] 122 sources -= [ "googlemock/src/gmock-all.cc" ] 123 public_configs = [ ":gmock_config" ] 124 configs += [ ":gmock_private_config" ] 125 configs -= [ "//build/config/coverage:default_coverage" ] 126 deps = [ ":gtest" ] 127} 128 129static_library("gmock_main") { 130 testonly = true 131 sources = [ "googlemock/src/gmock_main.cc" ] 132 public_deps = [ 133 ":gmock", 134 ":gtest", 135 ] 136 configs -= [ "//build/config/coverage:default_coverage" ] 137} 138