blob: e248bc1ba903d05528821cac75c0f2574ac0f127 [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]3de013992014-08-14 14:22:426 'includes': [
7 'gtest.gypi',
8 ],
[email protected]2f80c312009-02-25 21:26:559 'targets': [
10 {
11 'target_name': 'gtest',
[email protected]603ed1e82014-06-02 15:57:3312 'toolsets': ['host', 'target'],
[email protected]5a547332011-05-19 23:18:5313 'type': 'static_library',
[email protected]2f80c312009-02-25 21:26:5514 'sources': [
[email protected]3de013992014-08-14 14:22:4215 '<@(gtest_sources)',
[email protected]22015c332009-06-22 18:32:2116 ],
[email protected]2f80c312009-02-25 21:26:5517 'include_dirs': [
piman5623da42016-07-21 03:03:1518 'gtest',
19 'gtest/include',
[email protected]2f80c312009-02-25 21:26:5520 ],
[email protected]f30ef802011-12-02 15:27:5721 'dependencies': [
22 'gtest_prod',
23 ],
[email protected]e260ebc2013-12-18 05:31:3324 'defines': [
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 ],
29 'all_dependent_settings': {
tzikd805a40e2016-07-22 03:30:1830 'include_dirs': [
31 'gtest/include',
32 ],
[email protected]e260ebc2013-12-18 05:31:3333 'defines': [
34 'GTEST_HAS_POSIX_RE=0',
tzik025e90e62016-07-25 03:27:4835 'GTEST_LANG_CXX11=1',
[email protected]e260ebc2013-12-18 05:31:3336 ],
37 },
[email protected]2f80c312009-02-25 21:26:5538 'conditions': [
[email protected]17f7c4342012-07-09 14:41:1439 ['OS == "mac" or OS == "ios"', {
[email protected]1bba09c2009-08-13 12:53:1640 'sources': [
[email protected]ecebcc92010-08-06 02:39:2641 'gtest_mac.h',
42 'gtest_mac.mm',
eugenebuta016a7e2015-02-04 18:15:0043 'platform_test_mac.mm',
[email protected]1bba09c2009-08-13 12:53:1644 ],
[email protected]c77043fc2009-08-20 22:37:5945 'link_settings': {
46 'libraries': [
47 '$(SDKROOT)/System/Library/Frameworks/Foundation.framework',
48 ],
49 },
[email protected]1bba09c2009-08-13 12:53:1650 }],
[email protected]17f7c4342012-07-09 14:41:1451 ['OS == "ios"', {
[email protected]57871bc2012-08-20 16:28:1252 'dependencies' : [
[email protected]296bc452013-05-13 21:29:4753 '<(DEPTH)/testing/iossim/iossim.gyp:iossim#host',
[email protected]57871bc2012-08-20 16:28:1254 ],
[email protected]17f7c4342012-07-09 14:41:1455 'direct_dependent_settings': {
56 'target_conditions': [
57 # Turn all tests into bundles on iOS because that's the only
58 # type of executable supported for iOS.
59 ['_type=="executable"', {
60 'variables': {
61 # Use a variable so the path gets fixed up so it is always
62 # correct when INFOPLIST_FILE finally gets set.
63 'ios_unittest_info_plist_path':
64 '<(DEPTH)/testing/gtest_ios/unittest-Info.plist',
65 },
66 'mac_bundle': 1,
67 'xcode_settings': {
sdefresne727206c62016-07-13 14:40:3068 'BUNDLE_ID_TEST_NAME': '>(_target_name)',
[email protected]17f7c4342012-07-09 14:41:1469 'INFOPLIST_FILE': '>(ios_unittest_info_plist_path)',
70 },
71 'mac_bundle_resources': [
72 '<(ios_unittest_info_plist_path)',
rohitraod2f34882014-10-08 19:25:3173 '<(DEPTH)/testing/gtest_ios/Default.png',
[email protected]17f7c4342012-07-09 14:41:1474 ],
75 'mac_bundle_resources!': [
76 '<(ios_unittest_info_plist_path)',
77 ],
78 }],
79 ],
80 },
[email protected]9b00523e2014-07-10 00:41:0281 'sources': [
82 'coverage_util_ios.cc',
83 'coverage_util_ios.h',
[email protected]9b00523e2014-07-10 00:41:0284 ],
[email protected]17f7c4342012-07-09 14:41:1485 }],
[email protected]a22906d2013-07-03 08:26:5186 ['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"', {
91 'postbuilds': [
92 {
93 'variables': {
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',
99 },
100 'postbuild_name': 'Copy ASan runtime dylib',
101 'action': [
[email protected]a5963c52013-07-09 14:19:27102 '>(copy_asan_dylib_path)',
[email protected]a22906d2013-07-03 08:26:51103 ],
104 },
105 ],
106 }],
107 ],
108 },
109 }],
[email protected]f5c7758a2012-07-25 16:17:57110 ['OS=="android" and android_app_abi=="x86"', {
111 'defines': [
112 'GTEST_HAS_CLONE=0',
113 ],
114 'direct_dependent_settings': {
115 'defines': [
116 'GTEST_HAS_CLONE=0',
117 ],
118 },
119 }],
[email protected]2f80c312009-02-25 21:26:55120 ],
121 'direct_dependent_settings': {
122 'defines': [
123 'UNIT_TEST',
124 ],
[email protected]2f80c312009-02-25 21:26:55125 'target_conditions': [
[email protected]88555832010-12-17 16:04:03126 ['_type=="executable"', {
127 'test': 1,
128 'conditions': [
129 ['OS=="mac"', {
130 'run_as': {
131 'action????': ['${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}'],
132 },
133 }],
[email protected]17f7c4342012-07-09 14:41:14134 ['OS=="ios"', {
135 'variables': {
136 # Use a variable so the path gets fixed up so it is always
137 # correct when the action finally gets used.
138 'ios_run_unittest_script_path':
[email protected]58cddec22012-07-26 11:52:27139 '<(DEPTH)/testing/gtest_ios/run-unittest.sh',
[email protected]17f7c4342012-07-09 14:41:14140 },
141 'run_as': {
142 'action????': ['>(ios_run_unittest_script_path)'],
143 },
144 }],
[email protected]88555832010-12-17 16:04:03145 ['OS=="win"', {
146 'run_as': {
147 'action????': ['$(TargetPath)', '--gtest_print_time'],
148 },
149 }],
150 ],
151 }],
[email protected]2f80c312009-02-25 21:26:55152 ],
[email protected]c836d7a02009-10-03 20:47:21153 'msvs_disabled_warnings': [4800],
[email protected]2f80c312009-02-25 21:26:55154 },
155 },
[email protected]4b0f9632009-05-06 19:13:06156 {
[email protected]016498e2010-12-03 00:59:23157 'target_name': 'gtest_main',
[email protected]5a547332011-05-19 23:18:53158 'type': 'static_library',
[email protected]4b0f9632009-05-06 19:13:06159 'dependencies': [
160 'gtest',
161 ],
162 'sources': [
piman5623da42016-07-21 03:03:15163 'gtest/src/gtest_main.cc',
[email protected]4b0f9632009-05-06 19:13:06164 ],
165 },
[email protected]f30ef802011-12-02 15:27:57166 {
167 'target_name': 'gtest_prod',
168 'toolsets': ['host', 'target'],
169 'type': 'none',
170 'sources': [
171 'gtest/include/gtest/gtest_prod.h',
172 ],
173 },
[email protected]2f80c312009-02-25 21:26:55174 ],
175}