[email protected] | 17f7c434 | 2012-07-09 14:41:14 | [diff] [blame] | 1 | # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 2 | # 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] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 6 | 'targets': [ |
| 7 | { |
| 8 | 'target_name': 'gtest', |
[email protected] | 603ed1e8 | 2014-06-02 15:57:33 | [diff] [blame] | 9 | 'toolsets': ['host', 'target'], |
[email protected] | 5a54733 | 2011-05-19 23:18:53 | [diff] [blame] | 10 | 'type': 'static_library', |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 11 | 'sources': [ |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 12 | 'gtest/include/gtest/gtest-death-test.h', |
| 13 | 'gtest/include/gtest/gtest-message.h', |
| 14 | 'gtest/include/gtest/gtest-param-test.h', |
[email protected] | eac1cd26 | 2010-09-16 19:50:59 | [diff] [blame] | 15 | 'gtest/include/gtest/gtest-printers.h', |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 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', |
[email protected] | 22015c33 | 2009-06-22 18:32:21 | [diff] [blame] | 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', |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 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', |
[email protected] | eac1cd26 | 2010-09-16 19:50:59 | [diff] [blame] | 36 | 'gtest/src/gtest-printers.cc', |
[email protected] | 22015c33 | 2009-06-22 18:32:21 | [diff] [blame] | 37 | 'gtest/src/gtest-test-part.cc', |
| 38 | 'gtest/src/gtest-typed-test.cc', |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 39 | 'gtest/src/gtest.cc', |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 40 | 'multiprocess_func_list.cc', |
| 41 | 'multiprocess_func_list.h', |
| 42 | 'platform_test.h', |
| 43 | ], |
[email protected] | 22015c33 | 2009-06-22 18:32:21 | [diff] [blame] | 44 | 'sources!': [ |
| 45 | 'gtest/src/gtest-all.cc', # Not needed by our build. |
| 46 | ], |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 47 | 'include_dirs': [ |
| 48 | 'gtest', |
| 49 | 'gtest/include', |
| 50 | ], |
[email protected] | f30ef80 | 2011-12-02 15:27:57 | [diff] [blame] | 51 | 'dependencies': [ |
| 52 | 'gtest_prod', |
| 53 | ], |
[email protected] | e260ebc | 2013-12-18 05:31:33 | [diff] [blame] | 54 | '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] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 64 | 'conditions': [ |
[email protected] | 17f7c434 | 2012-07-09 14:41:14 | [diff] [blame] | 65 | ['OS == "mac" or OS == "ios"', { |
[email protected] | 1bba09c | 2009-08-13 12:53:16 | [diff] [blame] | 66 | 'sources': [ |
[email protected] | ecebcc9 | 2010-08-06 02:39:26 | [diff] [blame] | 67 | 'gtest_mac.h', |
| 68 | 'gtest_mac.mm', |
[email protected] | 1bba09c | 2009-08-13 12:53:16 | [diff] [blame] | 69 | ], |
[email protected] | c77043fc | 2009-08-20 22:37:59 | [diff] [blame] | 70 | 'link_settings': { |
| 71 | 'libraries': [ |
| 72 | '$(SDKROOT)/System/Library/Frameworks/Foundation.framework', |
| 73 | ], |
| 74 | }, |
[email protected] | 1bba09c | 2009-08-13 12:53:16 | [diff] [blame] | 75 | }], |
[email protected] | 9b00523e | 2014-07-10 00:41:02 | [diff] [blame^] | 76 | ['OS == "mac"', { |
| 77 | 'sources': [ |
| 78 | 'platform_test_mac.mm', |
| 79 | ], |
| 80 | }], |
[email protected] | 17f7c434 | 2012-07-09 14:41:14 | [diff] [blame] | 81 | ['OS == "ios"', { |
[email protected] | 57871bc | 2012-08-20 16:28:12 | [diff] [blame] | 82 | 'dependencies' : [ |
[email protected] | 296bc45 | 2013-05-13 21:29:47 | [diff] [blame] | 83 | '<(DEPTH)/testing/iossim/iossim.gyp:iossim#host', |
[email protected] | 57871bc | 2012-08-20 16:28:12 | [diff] [blame] | 84 | ], |
[email protected] | 17f7c434 | 2012-07-09 14:41:14 | [diff] [blame] | 85 | 'direct_dependent_settings': { |
| 86 | 'target_conditions': [ |
| 87 | # Turn all tests into bundles on iOS because that's the only |
| 88 | # type of executable supported for iOS. |
| 89 | ['_type=="executable"', { |
| 90 | 'variables': { |
| 91 | # Use a variable so the path gets fixed up so it is always |
| 92 | # correct when INFOPLIST_FILE finally gets set. |
| 93 | 'ios_unittest_info_plist_path': |
| 94 | '<(DEPTH)/testing/gtest_ios/unittest-Info.plist', |
| 95 | }, |
| 96 | 'mac_bundle': 1, |
| 97 | 'xcode_settings': { |
| 98 | 'BUNDLE_ID_TEST_NAME': |
| 99 | '>!(echo ">(_target_name)" | sed -e "s/_//g")', |
| 100 | 'INFOPLIST_FILE': '>(ios_unittest_info_plist_path)', |
| 101 | }, |
| 102 | 'mac_bundle_resources': [ |
| 103 | '<(ios_unittest_info_plist_path)', |
[email protected] | 3eef111 | 2013-02-21 18:40:20 | [diff] [blame] | 104 | '<(DEPTH)/testing/gtest_ios/[email protected]', |
[email protected] | 17f7c434 | 2012-07-09 14:41:14 | [diff] [blame] | 105 | ], |
| 106 | 'mac_bundle_resources!': [ |
| 107 | '<(ios_unittest_info_plist_path)', |
| 108 | ], |
| 109 | }], |
| 110 | ], |
| 111 | }, |
[email protected] | 9b00523e | 2014-07-10 00:41:02 | [diff] [blame^] | 112 | 'sources': [ |
| 113 | 'coverage_util_ios.cc', |
| 114 | 'coverage_util_ios.h', |
| 115 | 'platform_test_ios.mm', |
| 116 | ], |
[email protected] | 17f7c434 | 2012-07-09 14:41:14 | [diff] [blame] | 117 | }], |
[email protected] | a22906d | 2013-07-03 08:26:51 | [diff] [blame] | 118 | ['OS=="ios" and asan==1', { |
| 119 | 'direct_dependent_settings': { |
| 120 | 'target_conditions': [ |
| 121 | # Package the ASan runtime dylib into the test app bundles. |
| 122 | ['_type=="executable"', { |
| 123 | 'postbuilds': [ |
| 124 | { |
| 125 | 'variables': { |
| 126 | # Define copy_asan_dylib_path in a variable ending in |
| 127 | # _path so that gyp understands it's a path and |
| 128 | # performs proper relativization during dict merging. |
| 129 | 'copy_asan_dylib_path': |
| 130 | '<(DEPTH)/build/mac/copy_asan_runtime_dylib.sh', |
| 131 | }, |
| 132 | 'postbuild_name': 'Copy ASan runtime dylib', |
| 133 | 'action': [ |
[email protected] | a5963c5 | 2013-07-09 14:19:27 | [diff] [blame] | 134 | '>(copy_asan_dylib_path)', |
[email protected] | a22906d | 2013-07-03 08:26:51 | [diff] [blame] | 135 | ], |
| 136 | }, |
| 137 | ], |
| 138 | }], |
| 139 | ], |
| 140 | }, |
| 141 | }], |
[email protected] | 6a654d45 | 2011-05-23 22:06:54 | [diff] [blame] | 142 | ['os_posix == 1', { |
[email protected] | 1bba09c | 2009-08-13 12:53:16 | [diff] [blame] | 143 | 'defines': [ |
| 144 | # gtest isn't able to figure out when RTTI is disabled for gcc |
| 145 | # versions older than 4.3.2, and assumes it's enabled. Our Mac |
| 146 | # and Linux builds disable RTTI, and cannot guarantee that the |
| 147 | # compiler will be 4.3.2. or newer. The Mac, for example, uses |
| 148 | # 4.2.1 as that is the latest available on that platform. gtest |
| 149 | # must be instructed that RTTI is disabled here, and for any |
| 150 | # direct dependents that might include gtest headers. |
| 151 | 'GTEST_HAS_RTTI=0', |
| 152 | ], |
| 153 | 'direct_dependent_settings': { |
| 154 | 'defines': [ |
| 155 | 'GTEST_HAS_RTTI=0', |
| 156 | ], |
| 157 | }, |
| 158 | }], |
[email protected] | f5c7758a | 2012-07-25 16:17:57 | [diff] [blame] | 159 | ['OS=="android" and android_app_abi=="x86"', { |
| 160 | 'defines': [ |
| 161 | 'GTEST_HAS_CLONE=0', |
| 162 | ], |
| 163 | 'direct_dependent_settings': { |
| 164 | 'defines': [ |
| 165 | 'GTEST_HAS_CLONE=0', |
| 166 | ], |
| 167 | }, |
| 168 | }], |
[email protected] | 128cb99 | 2012-10-09 23:21:44 | [diff] [blame] | 169 | ['OS=="android"', { |
[email protected] | fbf26a0 | 2011-09-05 10:03:47 | [diff] [blame] | 170 | # We want gtest features that use tr1::tuple, but we currently |
| 171 | # don't support the variadic templates used by libstdc++'s |
| 172 | # implementation. gtest supports this scenario by providing its |
[email protected] | 58680ce | 2010-09-18 00:09:15 | [diff] [blame] | 173 | # own implementation but we must opt in to it. |
| 174 | 'defines': [ |
| 175 | 'GTEST_USE_OWN_TR1_TUPLE=1', |
[email protected] | c957f418 | 2012-12-03 21:28:14 | [diff] [blame] | 176 | # GTEST_USE_OWN_TR1_TUPLE only works if GTEST_HAS_TR1_TUPLE is set. |
| 177 | # gtest r625 made it so that GTEST_HAS_TR1_TUPLE is set to 0 |
| 178 | # automatically on android, so it has to be set explicitly here. |
| 179 | 'GTEST_HAS_TR1_TUPLE=1', |
[email protected] | 58680ce | 2010-09-18 00:09:15 | [diff] [blame] | 180 | ], |
| 181 | 'direct_dependent_settings': { |
| 182 | 'defines': [ |
| 183 | 'GTEST_USE_OWN_TR1_TUPLE=1', |
[email protected] | c957f418 | 2012-12-03 21:28:14 | [diff] [blame] | 184 | 'GTEST_HAS_TR1_TUPLE=1', |
[email protected] | 58680ce | 2010-09-18 00:09:15 | [diff] [blame] | 185 | ], |
| 186 | }, |
| 187 | }], |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 188 | ], |
| 189 | 'direct_dependent_settings': { |
| 190 | 'defines': [ |
| 191 | 'UNIT_TEST', |
| 192 | ], |
| 193 | 'include_dirs': [ |
[email protected] | 5290aaa | 2009-05-28 06:02:56 | [diff] [blame] | 194 | 'gtest/include', # So that gtest headers can find themselves. |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 195 | ], |
| 196 | 'target_conditions': [ |
[email protected] | 8855583 | 2010-12-17 16:04:03 | [diff] [blame] | 197 | ['_type=="executable"', { |
| 198 | 'test': 1, |
| 199 | 'conditions': [ |
| 200 | ['OS=="mac"', { |
| 201 | 'run_as': { |
| 202 | 'action????': ['${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}'], |
| 203 | }, |
| 204 | }], |
[email protected] | 17f7c434 | 2012-07-09 14:41:14 | [diff] [blame] | 205 | ['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] | 58cddec2 | 2012-07-26 11:52:27 | [diff] [blame] | 210 | '<(DEPTH)/testing/gtest_ios/run-unittest.sh', |
[email protected] | 17f7c434 | 2012-07-09 14:41:14 | [diff] [blame] | 211 | }, |
| 212 | 'run_as': { |
| 213 | 'action????': ['>(ios_run_unittest_script_path)'], |
| 214 | }, |
| 215 | }], |
[email protected] | 8855583 | 2010-12-17 16:04:03 | [diff] [blame] | 216 | ['OS=="win"', { |
| 217 | 'run_as': { |
| 218 | 'action????': ['$(TargetPath)', '--gtest_print_time'], |
| 219 | }, |
| 220 | }], |
| 221 | ], |
| 222 | }], |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 223 | ], |
[email protected] | c836d7a0 | 2009-10-03 20:47:21 | [diff] [blame] | 224 | 'msvs_disabled_warnings': [4800], |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 225 | }, |
| 226 | }, |
[email protected] | 4b0f963 | 2009-05-06 19:13:06 | [diff] [blame] | 227 | { |
[email protected] | 016498e | 2010-12-03 00:59:23 | [diff] [blame] | 228 | 'target_name': 'gtest_main', |
[email protected] | 5a54733 | 2011-05-19 23:18:53 | [diff] [blame] | 229 | 'type': 'static_library', |
[email protected] | 4b0f963 | 2009-05-06 19:13:06 | [diff] [blame] | 230 | 'dependencies': [ |
| 231 | 'gtest', |
| 232 | ], |
| 233 | 'sources': [ |
| 234 | 'gtest/src/gtest_main.cc', |
| 235 | ], |
| 236 | }, |
[email protected] | f30ef80 | 2011-12-02 15:27:57 | [diff] [blame] | 237 | { |
| 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] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 245 | ], |
| 246 | } |