OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import("//build_overrides/gtest.gni") | 5 import("//build_overrides/gtest.gni") |
| 6 if (is_ios) { |
| 7 import("//build/config/ios/ios_sdk.gni") |
| 8 import("//build/buildflag_header.gni") |
| 9 } |
6 | 10 |
7 config("gtest_config") { | 11 config("gtest_config") { |
8 visibility = [ | 12 visibility = [ |
9 ":*", | 13 ":*", |
10 "//testing/gmock:*", # gmock also shares this config. | 14 "//testing/gmock:*", # gmock also shares this config. |
11 ] | 15 ] |
12 | 16 |
13 defines = [ | 17 defines = [ |
14 # In order to allow regex matches in gtest to be shared between Windows | 18 # In order to allow regex matches in gtest to be shared between Windows |
15 # and other systems, we tell gtest to always use it's internal engine. | 19 # and other systems, we tell gtest to always use it's internal engine. |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 #"gtest/src/gtest-all.cc", # Not needed by our build. | 69 #"gtest/src/gtest-all.cc", # Not needed by our build. |
66 "src/gtest-death-test.cc", | 70 "src/gtest-death-test.cc", |
67 "src/gtest-filepath.cc", | 71 "src/gtest-filepath.cc", |
68 "src/gtest-internal-inl.h", | 72 "src/gtest-internal-inl.h", |
69 "src/gtest-port.cc", | 73 "src/gtest-port.cc", |
70 "src/gtest-printers.cc", | 74 "src/gtest-printers.cc", |
71 "src/gtest-test-part.cc", | 75 "src/gtest-test-part.cc", |
72 "src/gtest-typed-test.cc", | 76 "src/gtest-typed-test.cc", |
73 "src/gtest.cc", | 77 "src/gtest.cc", |
74 ] | 78 ] |
| 79 deps = [] |
75 | 80 |
76 if (gtest_include_multiprocess) { | 81 if (gtest_include_multiprocess) { |
77 sources += [ | 82 sources += [ |
78 "../multiprocess_func_list.cc", | 83 "../multiprocess_func_list.cc", |
79 "../multiprocess_func_list.h", | 84 "../multiprocess_func_list.h", |
80 ] | 85 ] |
81 } | 86 } |
82 | 87 |
83 if (gtest_include_platform_test) { | 88 if (gtest_include_platform_test) { |
84 sources += [ "../platform_test.h" ] | 89 sources += [ "../platform_test.h" ] |
85 } | 90 } |
86 | 91 |
87 if ((is_mac || is_ios) && gtest_include_objc_support) { | 92 if ((is_mac || is_ios) && gtest_include_objc_support) { |
88 if (is_ios) { | 93 if (is_ios) { |
89 set_sources_assignment_filter([]) | 94 set_sources_assignment_filter([]) |
90 } | 95 } |
91 sources += [ | 96 sources += [ |
92 "../gtest_mac.h", | 97 "../gtest_mac.h", |
93 "../gtest_mac.mm", | 98 "../gtest_mac.mm", |
94 ] | 99 ] |
95 if (gtest_include_platform_test) { | 100 if (gtest_include_platform_test) { |
96 sources += [ "../platform_test_mac.mm" ] | 101 sources += [ "../platform_test_mac.mm" ] |
97 } | 102 } |
98 set_sources_assignment_filter(sources_assignment_filter) | 103 set_sources_assignment_filter(sources_assignment_filter) |
99 } | 104 } |
100 | 105 |
101 if (is_ios && gtest_include_ios_coverage) { | 106 if (is_ios && gtest_include_ios_coverage) { |
102 sources += [ | 107 sources += [ |
103 "../coverage_util_ios.cc", | |
104 "../coverage_util_ios.h", | 108 "../coverage_util_ios.h", |
| 109 "../coverage_util_ios.mm", |
105 ] | 110 ] |
| 111 deps += [ ":ios_enable_coverage" ] |
106 } | 112 } |
107 | 113 |
108 include_dirs = [ "." ] | 114 include_dirs = [ "." ] |
109 | 115 |
110 all_dependent_configs = [ ":gtest_config" ] | 116 all_dependent_configs = [ ":gtest_config" ] |
111 public_configs = [ ":gtest_direct_config" ] | 117 public_configs = [ ":gtest_direct_config" ] |
112 | 118 |
113 configs -= [ "//build/config/compiler:chromium_code" ] | 119 configs -= [ "//build/config/compiler:chromium_code" ] |
114 configs += [ | 120 configs += [ |
115 "//build/config/compiler:no_chromium_code", | 121 "//build/config/compiler:no_chromium_code", |
116 | 122 |
117 # Must be after no_chromium_code for warning flags to be ordered correctly. | 123 # Must be after no_chromium_code for warning flags to be ordered correctly. |
118 ":gtest_warnings", | 124 ":gtest_warnings", |
119 ] | 125 ] |
120 } | 126 } |
121 | 127 |
122 source_set("gtest_main") { | 128 source_set("gtest_main") { |
123 testonly = true | 129 testonly = true |
124 sources = [ | 130 sources = [ |
125 "src/gtest_main.cc", | 131 "src/gtest_main.cc", |
126 ] | 132 ] |
127 deps = [ | 133 deps = [ |
128 ":gtest", | 134 ":gtest", |
129 ] | 135 ] |
130 } | 136 } |
| 137 |
| 138 if (is_ios) { |
| 139 buildflag_header("ios_enable_coverage") { |
| 140 header = "ios_enable_coverage.h" |
| 141 flags = [ "IOS_ENABLE_COVERAGE=$ios_enable_coverage" ] |
| 142 } |
| 143 } |
OLD | NEW |