blob: 486f3e774d6de9cf600e0b61c6cfac95b5a69abc [file] [log] [blame]
[email protected]17f7c4342012-07-09 14:41:141# Copyright (c) 2012 The Chromium Authors. All rights reserved.
[email protected]2f80c312009-02-25 21:26:552# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5{
[email protected]2f80c312009-02-25 21:26:556 'targets': [
7 {
8 'target_name': 'gtest',
[email protected]5a547332011-05-19 23:18:539 'type': 'static_library',
[email protected]2f80c312009-02-25 21:26:5510 'sources': [
[email protected]2f80c312009-02-25 21:26:5511 'gtest/include/gtest/gtest-death-test.h',
12 'gtest/include/gtest/gtest-message.h',
13 'gtest/include/gtest/gtest-param-test.h',
[email protected]eac1cd262010-09-16 19:50:5914 'gtest/include/gtest/gtest-printers.h',
[email protected]2f80c312009-02-25 21:26:5515 'gtest/include/gtest/gtest-spi.h',
16 'gtest/include/gtest/gtest-test-part.h',
17 'gtest/include/gtest/gtest-typed-test.h',
18 'gtest/include/gtest/gtest.h',
19 'gtest/include/gtest/gtest_pred_impl.h',
[email protected]22015c332009-06-22 18:32:2120 'gtest/include/gtest/internal/gtest-death-test-internal.h',
21 'gtest/include/gtest/internal/gtest-filepath.h',
22 'gtest/include/gtest/internal/gtest-internal.h',
23 'gtest/include/gtest/internal/gtest-linked_ptr.h',
24 'gtest/include/gtest/internal/gtest-param-util-generated.h',
25 'gtest/include/gtest/internal/gtest-param-util.h',
26 'gtest/include/gtest/internal/gtest-port.h',
27 'gtest/include/gtest/internal/gtest-string.h',
28 'gtest/include/gtest/internal/gtest-tuple.h',
29 'gtest/include/gtest/internal/gtest-type-util.h',
30 'gtest/src/gtest-all.cc',
[email protected]2f80c312009-02-25 21:26:5531 'gtest/src/gtest-death-test.cc',
32 'gtest/src/gtest-filepath.cc',
33 'gtest/src/gtest-internal-inl.h',
34 'gtest/src/gtest-port.cc',
[email protected]eac1cd262010-09-16 19:50:5935 'gtest/src/gtest-printers.cc',
[email protected]22015c332009-06-22 18:32:2136 'gtest/src/gtest-test-part.cc',
37 'gtest/src/gtest-typed-test.cc',
[email protected]2f80c312009-02-25 21:26:5538 'gtest/src/gtest.cc',
[email protected]2f80c312009-02-25 21:26:5539 'multiprocess_func_list.cc',
40 'multiprocess_func_list.h',
41 'platform_test.h',
42 ],
[email protected]22015c332009-06-22 18:32:2143 'sources!': [
44 'gtest/src/gtest-all.cc', # Not needed by our build.
45 ],
[email protected]2f80c312009-02-25 21:26:5546 'include_dirs': [
47 'gtest',
48 'gtest/include',
49 ],
[email protected]f30ef802011-12-02 15:27:5750 'dependencies': [
51 'gtest_prod',
52 ],
[email protected]e260ebc2013-12-18 05:31:3353 'defines': [
54 # In order to allow regex matches in gtest to be shared between Windows
55 # and other systems, we tell gtest to always use it's internal engine.
56 'GTEST_HAS_POSIX_RE=0',
57 ],
58 'all_dependent_settings': {
59 'defines': [
60 'GTEST_HAS_POSIX_RE=0',
61 ],
62 },
[email protected]2f80c312009-02-25 21:26:5563 'conditions': [
[email protected]17f7c4342012-07-09 14:41:1464 ['OS == "mac" or OS == "ios"', {
[email protected]1bba09c2009-08-13 12:53:1665 'sources': [
[email protected]ecebcc92010-08-06 02:39:2666 'gtest_mac.h',
67 'gtest_mac.mm',
[email protected]1bba09c2009-08-13 12:53:1668 'platform_test_mac.mm'
69 ],
[email protected]c77043fc2009-08-20 22:37:5970 'link_settings': {
71 'libraries': [
72 '$(SDKROOT)/System/Library/Frameworks/Foundation.framework',
73 ],
74 },
[email protected]1bba09c2009-08-13 12:53:1675 }],
[email protected]17f7c4342012-07-09 14:41:1476 ['OS == "ios"', {
[email protected]57871bc2012-08-20 16:28:1277 'dependencies' : [
[email protected]296bc452013-05-13 21:29:4778 '<(DEPTH)/testing/iossim/iossim.gyp:iossim#host',
[email protected]57871bc2012-08-20 16:28:1279 ],
[email protected]17f7c4342012-07-09 14:41:1480 'direct_dependent_settings': {
81 'target_conditions': [
82 # Turn all tests into bundles on iOS because that's the only
83 # type of executable supported for iOS.
84 ['_type=="executable"', {
85 'variables': {
86 # Use a variable so the path gets fixed up so it is always
87 # correct when INFOPLIST_FILE finally gets set.
88 'ios_unittest_info_plist_path':
89 '<(DEPTH)/testing/gtest_ios/unittest-Info.plist',
90 },
91 'mac_bundle': 1,
92 'xcode_settings': {
93 'BUNDLE_ID_TEST_NAME':
94 '>!(echo ">(_target_name)" | sed -e "s/_//g")',
95 'INFOPLIST_FILE': '>(ios_unittest_info_plist_path)',
96 },
97 'mac_bundle_resources': [
98 '<(ios_unittest_info_plist_path)',
[email protected]3eef1112013-02-21 18:40:2099 '<(DEPTH)/testing/gtest_ios/[email protected]',
[email protected]17f7c4342012-07-09 14:41:14100 ],
101 'mac_bundle_resources!': [
102 '<(ios_unittest_info_plist_path)',
103 ],
104 }],
105 ],
106 },
107 }],
[email protected]a22906d2013-07-03 08:26:51108 ['OS=="ios" and asan==1', {
109 'direct_dependent_settings': {
110 'target_conditions': [
111 # Package the ASan runtime dylib into the test app bundles.
112 ['_type=="executable"', {
113 'postbuilds': [
114 {
115 'variables': {
116 # Define copy_asan_dylib_path in a variable ending in
117 # _path so that gyp understands it's a path and
118 # performs proper relativization during dict merging.
119 'copy_asan_dylib_path':
120 '<(DEPTH)/build/mac/copy_asan_runtime_dylib.sh',
121 },
122 'postbuild_name': 'Copy ASan runtime dylib',
123 'action': [
[email protected]a5963c52013-07-09 14:19:27124 '>(copy_asan_dylib_path)',
[email protected]a22906d2013-07-03 08:26:51125 ],
126 },
127 ],
128 }],
129 ],
130 },
131 }],
[email protected]6a654d452011-05-23 22:06:54132 ['os_posix == 1', {
[email protected]1bba09c2009-08-13 12:53:16133 'defines': [
134 # gtest isn't able to figure out when RTTI is disabled for gcc
135 # versions older than 4.3.2, and assumes it's enabled. Our Mac
136 # and Linux builds disable RTTI, and cannot guarantee that the
137 # compiler will be 4.3.2. or newer. The Mac, for example, uses
138 # 4.2.1 as that is the latest available on that platform. gtest
139 # must be instructed that RTTI is disabled here, and for any
140 # direct dependents that might include gtest headers.
141 'GTEST_HAS_RTTI=0',
142 ],
143 'direct_dependent_settings': {
144 'defines': [
145 'GTEST_HAS_RTTI=0',
146 ],
147 },
148 }],
[email protected]f5c7758a2012-07-25 16:17:57149 ['OS=="android" and android_app_abi=="x86"', {
150 'defines': [
151 'GTEST_HAS_CLONE=0',
152 ],
153 'direct_dependent_settings': {
154 'defines': [
155 'GTEST_HAS_CLONE=0',
156 ],
157 },
158 }],
[email protected]128cb992012-10-09 23:21:44159 ['OS=="android"', {
[email protected]fbf26a02011-09-05 10:03:47160 # We want gtest features that use tr1::tuple, but we currently
161 # don't support the variadic templates used by libstdc++'s
162 # implementation. gtest supports this scenario by providing its
[email protected]58680ce2010-09-18 00:09:15163 # own implementation but we must opt in to it.
164 'defines': [
165 'GTEST_USE_OWN_TR1_TUPLE=1',
[email protected]c957f4182012-12-03 21:28:14166 # GTEST_USE_OWN_TR1_TUPLE only works if GTEST_HAS_TR1_TUPLE is set.
167 # gtest r625 made it so that GTEST_HAS_TR1_TUPLE is set to 0
168 # automatically on android, so it has to be set explicitly here.
169 'GTEST_HAS_TR1_TUPLE=1',
[email protected]58680ce2010-09-18 00:09:15170 ],
171 'direct_dependent_settings': {
172 'defines': [
173 'GTEST_USE_OWN_TR1_TUPLE=1',
[email protected]c957f4182012-12-03 21:28:14174 'GTEST_HAS_TR1_TUPLE=1',
[email protected]58680ce2010-09-18 00:09:15175 ],
176 },
177 }],
[email protected]78764182013-01-23 20:32:51178 ['OS=="win" and (MSVS_VERSION=="2012" or MSVS_VERSION=="2012e")', {
[email protected]128cb992012-10-09 23:21:44179 'defines': [
180 '_VARIADIC_MAX=10',
181 ],
182 'direct_dependent_settings': {
183 'defines': [
184 '_VARIADIC_MAX=10',
185 ],
186 },
187 }],
[email protected]2f80c312009-02-25 21:26:55188 ],
189 'direct_dependent_settings': {
190 'defines': [
191 'UNIT_TEST',
192 ],
193 'include_dirs': [
[email protected]5290aaa2009-05-28 06:02:56194 'gtest/include', # So that gtest headers can find themselves.
[email protected]2f80c312009-02-25 21:26:55195 ],
196 'target_conditions': [
[email protected]88555832010-12-17 16:04:03197 ['_type=="executable"', {
198 'test': 1,
199 'conditions': [
200 ['OS=="mac"', {
201 'run_as': {
202 'action????': ['${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}'],
203 },
204 }],
[email protected]17f7c4342012-07-09 14:41:14205 ['OS=="ios"', {
206 'variables': {
207 # Use a variable so the path gets fixed up so it is always
208 # correct when the action finally gets used.
209 'ios_run_unittest_script_path':
[email protected]58cddec22012-07-26 11:52:27210 '<(DEPTH)/testing/gtest_ios/run-unittest.sh',
[email protected]17f7c4342012-07-09 14:41:14211 },
212 'run_as': {
213 'action????': ['>(ios_run_unittest_script_path)'],
214 },
215 }],
[email protected]88555832010-12-17 16:04:03216 ['OS=="win"', {
217 'run_as': {
218 'action????': ['$(TargetPath)', '--gtest_print_time'],
219 },
220 }],
221 ],
222 }],
[email protected]2f80c312009-02-25 21:26:55223 ],
[email protected]c836d7a02009-10-03 20:47:21224 'msvs_disabled_warnings': [4800],
[email protected]2f80c312009-02-25 21:26:55225 },
226 },
[email protected]4b0f9632009-05-06 19:13:06227 {
[email protected]016498e2010-12-03 00:59:23228 'target_name': 'gtest_main',
[email protected]5a547332011-05-19 23:18:53229 'type': 'static_library',
[email protected]4b0f9632009-05-06 19:13:06230 'dependencies': [
231 'gtest',
232 ],
233 'sources': [
234 'gtest/src/gtest_main.cc',
235 ],
236 },
[email protected]f30ef802011-12-02 15:27:57237 {
238 'target_name': 'gtest_prod',
239 'toolsets': ['host', 'target'],
240 'type': 'none',
241 'sources': [
242 'gtest/include/gtest/gtest_prod.h',
243 ],
244 },
[email protected]2f80c312009-02-25 21:26:55245 ],
246}