1#
2#  Copyright 2016 Google, Inc.
3#
4#  Licensed under the Apache License, Version 2.0 (the "License");
5#  you may not use this file except in compliance with the License.
6#  You may obtain a copy of the License at:
7#
8#  http://www.apache.org/licenses/LICENSE-2.0
9#
10#  Unless required by applicable law or agreed to in writing, software
11#  distributed under the License is distributed on an "AS IS" BASIS,
12#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13#  See the License for the specific language governing permissions and
14#  limitations under the License.
15#
16
17config("gtest_config") {
18  # Gtest headers need to be able to find themselves.
19  include_dirs = [ "googletest/include" ]
20
21  defines = [ "GTEST_HAS_RTTI=0" ]
22}
23
24config("gtest_direct_config") {
25  visibility = [ ":*" ]
26  defines = [ "UNIT_TEST" ]
27}
28
29static_library("gtest") {
30  testonly = true
31  sources = [
32    "googletest/src/gtest-all.cc",
33  ]
34
35  include_dirs = [
36    "googletest/",
37    "googletest/include",
38  ]
39
40  all_dependent_configs = [ ":gtest_config" ]
41  public_configs = [ ":gtest_direct_config" ]
42}
43
44source_set("gtest_main") {
45  testonly = true
46  sources = [
47    "googletest/src/gtest_main.cc",
48  ]
49  deps = [
50    ":gtest",
51  ]
52}
53
54config("gmock_config") {
55  # Gmock headers need to be able to find themselves.
56  include_dirs = [ "googlemock/include" ]
57}
58
59static_library("gmock") {
60  testonly = true
61  sources = [
62    "googlemock/src/gmock-all.cc",
63  ]
64
65  # This project includes some stuff form gtest's guts.
66  include_dirs = [
67    "googlemock",
68    "googlemock/include",
69  ]
70
71  public_configs = [
72    ":gmock_config",
73    ":gtest_config",
74  ]
75}
76
77static_library("gmock_main") {
78  testonly = true
79  sources = [
80    "googlemock/src/gmock_main.cc",
81  ]
82  deps = [
83    ":gmock",
84    ":gtest",
85  ]
86
87  public_configs = [
88    ":gmock_config",
89    ":gtest_config",
90  ]
91}
92