1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
8 'target_name': 'gtest',
9 'toolsets': ['host', 'target'],
10 'type': 'static_library',
12 'gtest/include/gtest/gtest-death-test.h',
13 'gtest/include/gtest/gtest-message.h',
14 'gtest/include/gtest/gtest-param-test.h',
15 'gtest/include/gtest/gtest-printers.h',
16 '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',
21 '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',
32 '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',
36 'gtest/src/gtest-printers.cc',
37 'gtest/src/gtest-test-part.cc',
38 'gtest/src/gtest-typed-test.cc',
40 'multiprocess_func_list.cc',
41 'multiprocess_func_list.h',
45 'gtest/src/gtest-all.cc', # Not needed by our build.
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',
59 'all_dependent_settings': {
61 'GTEST_HAS_POSIX_RE=0',
65 ['OS == "mac" or OS == "ios"', {
69 'platform_test_mac.mm'
73 '$(SDKROOT)/System/Library/Frameworks/Foundation.framework',
79 '<(DEPTH)/testing/iossim/iossim.gyp:iossim#host',
81 '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"', {
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',
94 'BUNDLE_ID_TEST_NAME':
95 '>!(echo ">(_target_name)" | sed -e "s/_//g")',
96 'INFOPLIST_FILE': '>(ios_unittest_info_plist_path)',
98 'mac_bundle_resources': [
99 '<(ios_unittest_info_plist_path)',
100 '<(DEPTH)/testing/gtest_ios/Default-568h@2x.png',
102 'mac_bundle_resources!': [
103 '<(ios_unittest_info_plist_path)',
109 ['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"', {
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',
123 'postbuild_name': 'Copy ASan runtime dylib',
125 '>(copy_asan_dylib_path)',
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.
144 'direct_dependent_settings': {
150 ['OS=="android" and android_app_abi=="x86"', {
154 'direct_dependent_settings': {
161 # 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
164 # own implementation but we must opt in to it.
166 'GTEST_USE_OWN_TR1_TUPLE=1',
167 # 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',
172 'direct_dependent_settings': {
174 'GTEST_USE_OWN_TR1_TUPLE=1',
175 'GTEST_HAS_TR1_TUPLE=1',
180 'direct_dependent_settings': {
185 'gtest/include', # So that gtest headers can find themselves.
187 'target_conditions': [
188 ['_type=="executable"', {
193 'action????': ['${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}'],
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':
201 '<(DEPTH)/testing/gtest_ios/run-unittest.sh',
204 'action????': ['>(ios_run_unittest_script_path)'],
209 'action????': ['$(TargetPath)', '--gtest_print_time'],
215 'msvs_disabled_warnings': [4800],
219 'target_name': 'gtest_main',
220 'type': 'static_library',
225 'gtest/src/gtest_main.cc',
229 'target_name': 'gtest_prod',
230 'toolsets': ['host', 'target'],
233 'gtest/include/gtest/gtest_prod.h',