• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2020-2021 Huawei Device Co., Ltd.
2# Licensed under the Apache License, Version 2.0 (the "License");
3# you may not use this file except in compliance with the License.
4# You may obtain a copy of the License at
5#
6#     http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS,
10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13
14config("hcpptest_private_config") {
15  visibility = [ ":*" ]
16  include_dirs = [ "//third_party/googletest/googletest" ]
17  ldflags = [ "-lstdc++" ]
18  cflags_cc = [ "-std=c++17" ]
19  cflags = [ "-std=c++17" ]
20}
21
22config("hcpptest_config") {
23  include_dirs = [ "//third_party/googletest/googletest/include" ]
24  cflags_cc = [ "-std=c++17" ]
25  cflags = [ "-std=c++17" ]
26  ldflags = [
27    "-lstdc++",
28    "-Wl,-rpath=./lib",
29    "-lm",
30  ]
31}
32
33static_library("hcpptest") {
34  public = [
35    "//third_party/googletest/googletest/include/gtest/gtest-spi.h",
36    "//third_party/googletest/googletest/include/gtest/gtest.h",
37  ]
38  sources = [
39    "//third_party/googletest/googletest/include/gtest/gtest-death-test.h",
40    "//third_party/googletest/googletest/include/gtest/gtest-message.h",
41    "//third_party/googletest/googletest/include/gtest/gtest-param-test.h",
42    "//third_party/googletest/googletest/include/gtest/gtest-printers.h",
43    "//third_party/googletest/googletest/include/gtest/gtest-test-part.h",
44    "//third_party/googletest/googletest/include/gtest/gtest-typed-test.h",
45    "//third_party/googletest/googletest/include/gtest/gtest_pred_impl.h",
46    "//third_party/googletest/googletest/include/gtest/gtest_prod.h",
47    "//third_party/googletest/googletest/include/gtest/hwext/gtest-ext.h",
48    "//third_party/googletest/googletest/include/gtest/hwext/gtest-filter.h",
49    "//third_party/googletest/googletest/include/gtest/hwext/gtest-tag.h",
50    "//third_party/googletest/googletest/include/gtest/hwext/utils.h",
51    "//third_party/googletest/googletest/include/gtest/internal/custom/gtest-port.h",
52    "//third_party/googletest/googletest/include/gtest/internal/custom/gtest-printers.h",
53    "//third_party/googletest/googletest/include/gtest/internal/custom/gtest.h",
54    "//third_party/googletest/googletest/include/gtest/internal/gtest-death-test-internal.h",
55    "//third_party/googletest/googletest/include/gtest/internal/gtest-filepath.h",
56    "//third_party/googletest/googletest/include/gtest/internal/gtest-internal.h",
57    "//third_party/googletest/googletest/include/gtest/internal/gtest-linked_ptr.h",
58    "//third_party/googletest/googletest/include/gtest/internal/gtest-param-util-generated.h",
59    "//third_party/googletest/googletest/include/gtest/internal/gtest-param-util.h",
60    "//third_party/googletest/googletest/include/gtest/internal/gtest-port-arch.h",
61    "//third_party/googletest/googletest/include/gtest/internal/gtest-port.h",
62    "//third_party/googletest/googletest/include/gtest/internal/gtest-string.h",
63    "//third_party/googletest/googletest/include/gtest/internal/gtest-tuple.h",
64    "//third_party/googletest/googletest/include/gtest/internal/gtest-type-util.h",
65    "//third_party/googletest/googletest/src/gtest-assertion-result.cc",
66    "//third_party/googletest/googletest/src/gtest-death-test.cc",
67    "//third_party/googletest/googletest/src/gtest-filepath.cc",
68    "//third_party/googletest/googletest/src/gtest-internal-inl.h",
69    "//third_party/googletest/googletest/src/gtest-port.cc",
70    "//third_party/googletest/googletest/src/gtest-printers.cc",
71    "//third_party/googletest/googletest/src/gtest-test-part.cc",
72    "//third_party/googletest/googletest/src/gtest-typed-test.cc",
73    "//third_party/googletest/googletest/src/gtest.cc",
74    "//third_party/googletest/googletest/src/hwext/gtest-ext.cc",
75    "//third_party/googletest/googletest/src/hwext/gtest-filter.cc",
76    "//third_party/googletest/googletest/src/hwext/gtest-tag.cc",
77    "//third_party/googletest/googletest/src/hwext/gtest-utils.cc",
78  ]
79  public_configs = [ ":hcpptest_config" ]
80  configs += [ ":hcpptest_private_config" ]
81  defines = [ "GTEST_HAS_CLONE=0" ]
82}
83
84static_library("hcpptest_main") {
85  sources = [ "//third_party/googletest/googletest/src/gtest_main.cc" ]
86  public_deps = [ ":hcpptest" ]
87}
88
89config("gmock_private_config") {
90  visibility = [ ":*" ]
91  include_dirs = [ "//third_party/googletest/googlemock" ]
92}
93
94config("gmock_config") {
95  include_dirs = [ "//third_party/googletest/googlemock/include" ]
96
97  cflags_cc = [
98    # The MOCK_METHODn() macros do not specify "override", which triggers this
99    # warning in users: "error: 'Method' overrides a member function but is not
100    # marked 'override' [-Werror,-Winconsistent-missing-override]". Suppress
101    # these warnings until https://github.com/google/googletest/issues/533 is
102    # fixed.
103    "-Wno-inconsistent-missing-override",
104  ]
105}
106
107static_library("gmock") {
108  public = [ "//third_party/googletest/googlemock/include/gmock/gmock.h" ]
109  sources = [
110    "//third_party/googletest/googlemock/include/gmock/gmock-actions.h",
111    "//third_party/googletest/googlemock/include/gmock/gmock-cardinalities.h",
112    "//third_party/googletest/googlemock/include/gmock/gmock-generated-actions.h",
113    "//third_party/googletest/googlemock/include/gmock/gmock-generated-function-mockers.h",
114    "//third_party/googletest/googlemock/include/gmock/gmock-generated-matchers.h",
115    "//third_party/googletest/googlemock/include/gmock/gmock-generated-nice-strict.h",
116    "//third_party/googletest/googlemock/include/gmock/gmock-matchers.h",
117    "//third_party/googletest/googlemock/include/gmock/gmock-more-actions.h",
118    "//third_party/googletest/googlemock/include/gmock/gmock-more-matchers.h",
119    "//third_party/googletest/googlemock/include/gmock/gmock-spec-builders.h",
120    "//third_party/googletest/googlemock/include/gmock/internal/custom/gmock-generated-actions.h",
121    "//third_party/googletest/googlemock/include/gmock/internal/custom/gmock-matchers.h",
122    "//third_party/googletest/googlemock/include/gmock/internal/custom/gmock-port.h",
123    "//third_party/googletest/googlemock/include/gmock/internal/gmock-generated-internal-utils.h",
124    "//third_party/googletest/googlemock/include/gmock/internal/gmock-internal-utils.h",
125    "//third_party/googletest/googlemock/include/gmock/internal/gmock-port.h",
126    "//third_party/googletest/googlemock/src/gmock-cardinalities.cc",
127    "//third_party/googletest/googlemock/src/gmock-internal-utils.cc",
128    "//third_party/googletest/googlemock/src/gmock-matchers.cc",
129    "//third_party/googletest/googlemock/src/gmock-spec-builders.cc",
130    "//third_party/googletest/googlemock/src/gmock.cc",
131  ]
132  public_configs = [ ":gmock_config" ]
133  configs += [ ":gmock_private_config" ]
134  deps = [ ":hcpptest" ]
135}
136
137static_library("gmock_main") {
138  sources = [ "//third_party/googletest/googlemock/src/gmock_main.cc" ]
139  public_deps = [
140    ":gmock",
141    ":hcpptest",
142  ]
143}
144