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_private_config_rtti") { 11 visibility = [ ":*" ] 12 include_dirs = [ "googletest" ] 13 cflags = [ "-frtti" ] 14 cflags_objcc = [ "-frtti" ] 15 cflags_cc = [ "-frtti" ] 16} 17 18config("gtest_config") { 19 include_dirs = [ "googletest/include" ] 20 if (is_mingw) { 21 cflags_cc = [ 22 "-Wno-unused-const-variable", 23 "-Wno-unused-private-field", 24 ] 25 } 26} 27 28sources_files = [ 29 "googletest/include/gtest/gtest-death-test.h", 30 "googletest/include/gtest/gtest-matchers.h", 31 "googletest/include/gtest/gtest-message.h", 32 "googletest/include/gtest/gtest-param-test.h", 33 "googletest/include/gtest/gtest-printers.h", 34 "googletest/include/gtest/gtest-test-part.h", 35 "googletest/include/gtest/gtest-typed-test.h", 36 "googletest/include/gtest/gtest_pred_impl.h", 37 "googletest/include/gtest/gtest_prod.h", 38 "googletest/include/gtest/hwext/gtest-ext.h", 39 "googletest/include/gtest/hwext/gtest-filter.h", 40 "googletest/include/gtest/hwext/gtest-multithread.h", 41 "googletest/include/gtest/hwext/gtest-tag.h", 42 "googletest/include/gtest/hwext/utils.h", 43 "googletest/include/gtest/internal/custom/gtest-port.h", 44 "googletest/include/gtest/internal/custom/gtest-printers.h", 45 "googletest/include/gtest/internal/custom/gtest.h", 46 "googletest/include/gtest/internal/gtest-death-test-internal.h", 47 "googletest/include/gtest/internal/gtest-filepath.h", 48 "googletest/include/gtest/internal/gtest-internal.h", 49 "googletest/include/gtest/internal/gtest-param-util.h", 50 "googletest/include/gtest/internal/gtest-port-arch.h", 51 "googletest/include/gtest/internal/gtest-port.h", 52 "googletest/include/gtest/internal/gtest-string.h", 53 "googletest/include/gtest/internal/gtest-type-util.h", 54 "googletest/src/gtest-all.cc", 55 "googletest/src/gtest-death-test.cc", 56 "googletest/src/gtest-filepath.cc", 57 "googletest/src/gtest-internal-inl.h", 58 "googletest/src/gtest-matchers.cc", 59 "googletest/src/gtest-port.cc", 60 "googletest/src/gtest-printers.cc", 61 "googletest/src/gtest-test-part.cc", 62 "googletest/src/gtest-typed-test.cc", 63 "googletest/src/gtest.cc", 64 "googletest/src/hwext/gtest-ext.cc", 65 "googletest/src/hwext/gtest-filter.cc", 66 "googletest/src/hwext/gtest-multithread.cpp", 67 "googletest/src/hwext/gtest-tag.cc", 68 "googletest/src/hwext/gtest-utils.cc", 69] 70 71static_library("gtest") { 72 testonly = true 73 public = [ 74 "googletest/include/gtest/gtest-spi.h", 75 "googletest/include/gtest/gtest.h", 76 ] 77 sources = sources_files 78 sources -= [ "googletest/src/gtest-all.cc" ] 79 public_configs = [ ":gtest_config" ] 80 configs += [ ":gtest_private_config" ] 81 configs -= [ "//build/config/coverage:default_coverage" ] 82} 83 84static_library("gtest_rtti") { 85 testonly = true 86 public = [ 87 "googletest/include/gtest/gtest-spi.h", 88 "googletest/include/gtest/gtest.h", 89 ] 90 sources = sources_files 91 sources -= [ "googletest/src/gtest-all.cc" ] 92 public_configs = [ ":gtest_config" ] 93 configs += [ ":gtest_private_config_rtti" ] 94 configs -= [ "//build/config/coverage:default_coverage" ] 95} 96 97static_library("gtest_main") { 98 testonly = true 99 sources = [ "googletest/src/gtest_main.cc" ] 100 public_deps = [ ":gtest" ] 101 configs -= [ "//build/config/coverage:default_coverage" ] 102} 103 104config("gmock_private_config") { 105 visibility = [ ":*" ] 106 include_dirs = [ "googlemock" ] 107} 108 109config("gmock_config") { 110 include_dirs = [ "googlemock/include" ] 111 112 cflags_cc = [ 113 # The MOCK_METHODn() macros do not specify "override", which triggers this 114 # warning in users: "error: 'Method' overrides a member function but is not 115 # marked 'override' [-Werror,-Winconsistent-missing-override]". Suppress 116 # these warnings until https://github.com/google/googletest/issues/533 is 117 # fixed. 118 "-Wno-inconsistent-missing-override", 119 ] 120} 121 122static_library("gmock") { 123 testonly = true 124 public = [ "googlemock/include/gmock/gmock.h" ] 125 sources = [ 126 "googlemock/include/gmock/gmock-actions.h", 127 "googlemock/include/gmock/gmock-cardinalities.h", 128 "googlemock/include/gmock/gmock-function-mocker.h", 129 "googlemock/include/gmock/gmock-matchers.h", 130 "googlemock/include/gmock/gmock-more-actions.h", 131 "googlemock/include/gmock/gmock-more-matchers.h", 132 "googlemock/include/gmock/gmock-nice-strict.h", 133 "googlemock/include/gmock/gmock-spec-builders.h", 134 "googlemock/include/gmock/internal/custom/gmock-generated-actions.h", 135 "googlemock/include/gmock/internal/custom/gmock-matchers.h", 136 "googlemock/include/gmock/internal/custom/gmock-port.h", 137 "googlemock/include/gmock/internal/gmock-internal-utils.h", 138 "googlemock/include/gmock/internal/gmock-port.h", 139 "googlemock/include/gmock/internal/gmock-pp.h", 140 "googlemock/src/gmock-all.cc", 141 "googlemock/src/gmock-cardinalities.cc", 142 "googlemock/src/gmock-internal-utils.cc", 143 "googlemock/src/gmock-matchers.cc", 144 "googlemock/src/gmock-spec-builders.cc", 145 "googlemock/src/gmock.cc", 146 ] 147 sources -= [ "googlemock/src/gmock-all.cc" ] 148 public_configs = [ ":gmock_config" ] 149 configs += [ ":gmock_private_config" ] 150 configs -= [ "//build/config/coverage:default_coverage" ] 151 deps = [ ":gtest" ] 152} 153 154static_library("gmock_main") { 155 testonly = true 156 sources = [ "googlemock/src/gmock_main.cc" ] 157 public_deps = [ 158 ":gmock", 159 ":gtest", 160 ] 161 configs -= [ "//build/config/coverage:default_coverage" ] 162} 163