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