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.
11 'target_name': 'gtest',
12 'toolsets': ['host', 'target'],
13 'type': 'static_library',
25 # In order to allow regex matches in gtest to be shared between Windows
26 # and other systems, we tell gtest to always use it's internal engine.
27 'GTEST_HAS_POSIX_RE=0',
28 # Chrome doesn't support / require C++11, yet.
31 'all_dependent_settings': {
33 'GTEST_HAS_POSIX_RE=0',
38 ['OS == "mac" or OS == "ios"', {
42 'platform_test_mac.mm',
46 '$(SDKROOT)/System/Library/Frameworks/Foundation.framework',
52 '<(DEPTH)/testing/iossim/iossim.gyp:iossim#host',
54 'direct_dependent_settings': {
55 'target_conditions': [
56 # Turn all tests into bundles on iOS because that's the only
57 # type of executable supported for iOS.
58 ['_type=="executable"', {
60 # Use a variable so the path gets fixed up so it is always
61 # correct when INFOPLIST_FILE finally gets set.
62 'ios_unittest_info_plist_path':
63 '<(DEPTH)/testing/gtest_ios/unittest-Info.plist',
67 'BUNDLE_ID_TEST_NAME':
68 '>!(echo ">(_target_name)" | sed -e "s/_//g")',
69 'INFOPLIST_FILE': '>(ios_unittest_info_plist_path)',
71 'mac_bundle_resources': [
72 '<(ios_unittest_info_plist_path)',
73 '<(DEPTH)/testing/gtest_ios/Default.png',
75 'mac_bundle_resources!': [
76 '<(ios_unittest_info_plist_path)',
82 'coverage_util_ios.cc',
83 'coverage_util_ios.h',
86 ['OS=="ios" and asan==1', {
87 'direct_dependent_settings': {
88 'target_conditions': [
89 # Package the ASan runtime dylib into the test app bundles.
90 ['_type=="executable"', {
94 # Define copy_asan_dylib_path in a variable ending in
95 # _path so that gyp understands it's a path and
96 # performs proper relativization during dict merging.
97 'copy_asan_dylib_path':
98 '<(DEPTH)/build/mac/copy_asan_runtime_dylib.sh',
100 'postbuild_name': 'Copy ASan runtime dylib',
102 '>(copy_asan_dylib_path)',
112 # gtest isn't able to figure out when RTTI is disabled for gcc
113 # versions older than 4.3.2, and assumes it's enabled. Our Mac
114 # and Linux builds disable RTTI, and cannot guarantee that the
115 # compiler will be 4.3.2. or newer. The Mac, for example, uses
116 # 4.2.1 as that is the latest available on that platform. gtest
117 # must be instructed that RTTI is disabled here, and for any
118 # direct dependents that might include gtest headers.
121 'direct_dependent_settings': {
127 ['OS=="android" and android_app_abi=="x86"', {
131 'direct_dependent_settings': {
138 # We want gtest features that use tr1::tuple, but we currently
139 # don't support the variadic templates used by libstdc++'s
140 # implementation. gtest supports this scenario by providing its
141 # own implementation but we must opt in to it.
143 'GTEST_USE_OWN_TR1_TUPLE=1',
144 # GTEST_USE_OWN_TR1_TUPLE only works if GTEST_HAS_TR1_TUPLE is set.
145 # gtest r625 made it so that GTEST_HAS_TR1_TUPLE is set to 0
146 # automatically on android, so it has to be set explicitly here.
147 'GTEST_HAS_TR1_TUPLE=1',
149 'direct_dependent_settings': {
151 'GTEST_USE_OWN_TR1_TUPLE=1',
152 'GTEST_HAS_TR1_TUPLE=1',
157 'direct_dependent_settings': {
162 'gtest/include', # So that gtest headers can find themselves.
164 'target_conditions': [
165 ['_type=="executable"', {
170 'action????': ['${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}'],
175 # Use a variable so the path gets fixed up so it is always
176 # correct when the action finally gets used.
177 'ios_run_unittest_script_path':
178 '<(DEPTH)/testing/gtest_ios/run-unittest.sh',
181 'action????': ['>(ios_run_unittest_script_path)'],
186 'action????': ['$(TargetPath)', '--gtest_print_time'],
192 'msvs_disabled_warnings': [4800],
196 'target_name': 'gtest_main',
197 'type': 'static_library',
202 'gtest/src/gtest_main.cc',
206 'target_name': 'gtest_prod',
207 'toolsets': ['host', 'target'],
210 'gtest/include/gtest/gtest_prod.h',