blob: 69b2bf5e5295f9c41842a57f51325ded93d0c4c9 [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]603ed1e82014-06-02 15:57:339 'toolsets': ['host', 'target'],
[email protected]5a547332011-05-19 23:18:5310 'type': 'static_library',
[email protected]2f80c312009-02-25 21:26:5511 'sources': [
[email protected]2f80c312009-02-25 21:26:5512 'gtest/include/gtest/gtest-death-test.h',
13 'gtest/include/gtest/gtest-message.h',
14 'gtest/include/gtest/gtest-param-test.h',
[email protected]eac1cd262010-09-16 19:50:5915 'gtest/include/gtest/gtest-printers.h',
[email protected]2f80c312009-02-25 21:26:5516 'gtest/include/gtest/gtest-spi.h',
17 'gtest/include/gtest/gtest-test-part.h',
18 'gtest/include/gtest/gtest-typed-test.h',
19 'gtest/include/gtest/gtest.h',
20 'gtest/include/gtest/gtest_pred_impl.h',
[email protected]22015c332009-06-22 18:32:2121 'gtest/include/gtest/internal/gtest-death-test-internal.h',
22 'gtest/include/gtest/internal/gtest-filepath.h',
23 'gtest/include/gtest/internal/gtest-internal.h',
24 'gtest/include/gtest/internal/gtest-linked_ptr.h',
25 'gtest/include/gtest/internal/gtest-param-util-generated.h',
26 'gtest/include/gtest/internal/gtest-param-util.h',
27 'gtest/include/gtest/internal/gtest-port.h',
28 'gtest/include/gtest/internal/gtest-string.h',
29 'gtest/include/gtest/internal/gtest-tuple.h',
30 'gtest/include/gtest/internal/gtest-type-util.h',
31 'gtest/src/gtest-all.cc',
[email protected]2f80c312009-02-25 21:26:5532 'gtest/src/gtest-death-test.cc',
33 'gtest/src/gtest-filepath.cc',
34 'gtest/src/gtest-internal-inl.h',
35 'gtest/src/gtest-port.cc',
[email protected]eac1cd262010-09-16 19:50:5936 'gtest/src/gtest-printers.cc',
[email protected]22015c332009-06-22 18:32:2137 'gtest/src/gtest-test-part.cc',
38 'gtest/src/gtest-typed-test.cc',
[email protected]2f80c312009-02-25 21:26:5539 'gtest/src/gtest.cc',
[email protected]2f80c312009-02-25 21:26:5540 'multiprocess_func_list.cc',
41 'multiprocess_func_list.h',
42 'platform_test.h',
43 ],
[email protected]22015c332009-06-22 18:32:2144 'sources!': [
45 'gtest/src/gtest-all.cc', # Not needed by our build.
46 ],
[email protected]2f80c312009-02-25 21:26:5547 'include_dirs': [
48 'gtest',
49 'gtest/include',
50 ],
[email protected]f30ef802011-12-02 15:27:5751 'dependencies': [
52 'gtest_prod',
53 ],
[email protected]e260ebc2013-12-18 05:31:3354 'defines': [
55 # In order to allow regex matches in gtest to be shared between Windows
56 # and other systems, we tell gtest to always use it's internal engine.
57 'GTEST_HAS_POSIX_RE=0',
58 ],
59 'all_dependent_settings': {
60 'defines': [
61 'GTEST_HAS_POSIX_RE=0',
62 ],
63 },
[email protected]2f80c312009-02-25 21:26:5564 'conditions': [
[email protected]17f7c4342012-07-09 14:41:1465 ['OS == "mac" or OS == "ios"', {
[email protected]1bba09c2009-08-13 12:53:1666 'sources': [
[email protected]ecebcc92010-08-06 02:39:2667 'gtest_mac.h',
68 'gtest_mac.mm',
[email protected]1bba09c2009-08-13 12:53:1669 'platform_test_mac.mm'
70 ],
[email protected]c77043fc2009-08-20 22:37:5971 'link_settings': {
72 'libraries': [
73 '$(SDKROOT)/System/Library/Frameworks/Foundation.framework',
74 ],
75 },
[email protected]1bba09c2009-08-13 12:53:1676 }],
[email protected]17f7c4342012-07-09 14:41:1477 ['OS == "ios"', {
[email protected]57871bc2012-08-20 16:28:1278 'dependencies' : [
[email protected]296bc452013-05-13 21:29:4779 '<(DEPTH)/testing/iossim/iossim.gyp:iossim#host',
[email protected]57871bc2012-08-20 16:28:1280 ],
[email protected]17f7c4342012-07-09 14:41:1481 'direct_dependent_settings': {
82 'target_conditions': [
83 # Turn all tests into bundles on iOS because that's the only
84 # type of executable supported for iOS.
85 ['_type=="executable"', {
86 'variables': {
87 # Use a variable so the path gets fixed up so it is always
88 # correct when INFOPLIST_FILE finally gets set.
89 'ios_unittest_info_plist_path':
90 '<(DEPTH)/testing/gtest_ios/unittest-Info.plist',
91 },
92 'mac_bundle': 1,
93 'xcode_settings': {
94 'BUNDLE_ID_TEST_NAME':
95 '>!(echo ">(_target_name)" | sed -e "s/_//g")',
96 'INFOPLIST_FILE': '>(ios_unittest_info_plist_path)',
97 },
98 'mac_bundle_resources': [
99 '<(ios_unittest_info_plist_path)',
[email protected]3eef1112013-02-21 18:40:20100 '<(DEPTH)/testing/gtest_ios/[email protected]',
[email protected]17f7c4342012-07-09 14:41:14101 ],
102 'mac_bundle_resources!': [
103 '<(ios_unittest_info_plist_path)',
104 ],
105 }],
106 ],
107 },
108 }],
[email protected]a22906d2013-07-03 08:26:51109 ['OS=="ios" and asan==1', {
110 'direct_dependent_settings': {
111 'target_conditions': [
112 # Package the ASan runtime dylib into the test app bundles.
113 ['_type=="executable"', {
114 'postbuilds': [
115 {
116 'variables': {
117 # Define copy_asan_dylib_path in a variable ending in
118 # _path so that gyp understands it's a path and
119 # performs proper relativization during dict merging.
120 'copy_asan_dylib_path':
121 '<(DEPTH)/build/mac/copy_asan_runtime_dylib.sh',
122 },
123 'postbuild_name': 'Copy ASan runtime dylib',
124 'action': [
[email protected]a5963c52013-07-09 14:19:27125 '>(copy_asan_dylib_path)',
[email protected]a22906d2013-07-03 08:26:51126 ],
127 },
128 ],
129 }],
130 ],
131 },
132 }],
[email protected]6a654d452011-05-23 22:06:54133 ['os_posix == 1', {
[email protected]1bba09c2009-08-13 12:53:16134 'defines': [
135 # gtest isn't able to figure out when RTTI is disabled for gcc
136 # versions older than 4.3.2, and assumes it's enabled. Our Mac
137 # and Linux builds disable RTTI, and cannot guarantee that the
138 # compiler will be 4.3.2. or newer. The Mac, for example, uses
139 # 4.2.1 as that is the latest available on that platform. gtest
140 # must be instructed that RTTI is disabled here, and for any
141 # direct dependents that might include gtest headers.
142 'GTEST_HAS_RTTI=0',
143 ],
144 'direct_dependent_settings': {
145 'defines': [
146 'GTEST_HAS_RTTI=0',
147 ],
148 },
149 }],
[email protected]f5c7758a2012-07-25 16:17:57150 ['OS=="android" and android_app_abi=="x86"', {
151 'defines': [
152 'GTEST_HAS_CLONE=0',
153 ],
154 'direct_dependent_settings': {
155 'defines': [
156 'GTEST_HAS_CLONE=0',
157 ],
158 },
159 }],
[email protected]128cb992012-10-09 23:21:44160 ['OS=="android"', {
[email protected]fbf26a02011-09-05 10:03:47161 # We want gtest features that use tr1::tuple, but we currently
162 # don't support the variadic templates used by libstdc++'s
163 # implementation. gtest supports this scenario by providing its
[email protected]58680ce2010-09-18 00:09:15164 # own implementation but we must opt in to it.
165 'defines': [
166 'GTEST_USE_OWN_TR1_TUPLE=1',
[email protected]c957f4182012-12-03 21:28:14167 # GTEST_USE_OWN_TR1_TUPLE only works if GTEST_HAS_TR1_TUPLE is set.
168 # gtest r625 made it so that GTEST_HAS_TR1_TUPLE is set to 0
169 # automatically on android, so it has to be set explicitly here.
170 'GTEST_HAS_TR1_TUPLE=1',
[email protected]58680ce2010-09-18 00:09:15171 ],
172 'direct_dependent_settings': {
173 'defines': [
174 'GTEST_USE_OWN_TR1_TUPLE=1',
[email protected]c957f4182012-12-03 21:28:14175 'GTEST_HAS_TR1_TUPLE=1',
[email protected]58680ce2010-09-18 00:09:15176 ],
177 },
178 }],
[email protected]2f80c312009-02-25 21:26:55179 ],
180 'direct_dependent_settings': {
181 'defines': [
182 'UNIT_TEST',
183 ],
184 'include_dirs': [
[email protected]5290aaa2009-05-28 06:02:56185 'gtest/include', # So that gtest headers can find themselves.
[email protected]2f80c312009-02-25 21:26:55186 ],
187 'target_conditions': [
[email protected]88555832010-12-17 16:04:03188 ['_type=="executable"', {
189 'test': 1,
190 'conditions': [
191 ['OS=="mac"', {
192 'run_as': {
193 'action????': ['${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}'],
194 },
195 }],
[email protected]17f7c4342012-07-09 14:41:14196 ['OS=="ios"', {
197 'variables': {
198 # Use a variable so the path gets fixed up so it is always
199 # correct when the action finally gets used.
200 'ios_run_unittest_script_path':
[email protected]58cddec22012-07-26 11:52:27201 '<(DEPTH)/testing/gtest_ios/run-unittest.sh',
[email protected]17f7c4342012-07-09 14:41:14202 },
203 'run_as': {
204 'action????': ['>(ios_run_unittest_script_path)'],
205 },
206 }],
[email protected]88555832010-12-17 16:04:03207 ['OS=="win"', {
208 'run_as': {
209 'action????': ['$(TargetPath)', '--gtest_print_time'],
210 },
211 }],
212 ],
213 }],
[email protected]2f80c312009-02-25 21:26:55214 ],
[email protected]c836d7a02009-10-03 20:47:21215 'msvs_disabled_warnings': [4800],
[email protected]2f80c312009-02-25 21:26:55216 },
217 },
[email protected]4b0f9632009-05-06 19:13:06218 {
[email protected]016498e2010-12-03 00:59:23219 'target_name': 'gtest_main',
[email protected]5a547332011-05-19 23:18:53220 'type': 'static_library',
[email protected]4b0f9632009-05-06 19:13:06221 'dependencies': [
222 'gtest',
223 ],
224 'sources': [
225 'gtest/src/gtest_main.cc',
226 ],
227 },
[email protected]f30ef802011-12-02 15:27:57228 {
229 'target_name': 'gtest_prod',
230 'toolsets': ['host', 'target'],
231 'type': 'none',
232 'sources': [
233 'gtest/include/gtest/gtest_prod.h',
234 ],
235 },
[email protected]2f80c312009-02-25 21:26:55236 ],
237}