[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] | 3de01399 | 2014-08-14 14:22:42 | [diff] [blame] | 6 | 'includes': [ |
| 7 | 'gtest.gypi', |
| 8 | ], |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 9 | 'targets': [ |
| 10 | { |
| 11 | 'target_name': 'gtest', |
[email protected] | 603ed1e8 | 2014-06-02 15:57:33 | [diff] [blame] | 12 | 'toolsets': ['host', 'target'], |
[email protected] | 5a54733 | 2011-05-19 23:18:53 | [diff] [blame] | 13 | 'type': 'static_library', |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 14 | 'sources': [ |
[email protected] | 3de01399 | 2014-08-14 14:22:42 | [diff] [blame] | 15 | '<@(gtest_sources)', |
[email protected] | 22015c33 | 2009-06-22 18:32:21 | [diff] [blame] | 16 | ], |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 17 | 'include_dirs': [ |
piman | 5623da4 | 2016-07-21 03:03:15 | [diff] [blame] | 18 | 'gtest', |
| 19 | 'gtest/include', |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 20 | ], |
[email protected] | f30ef80 | 2011-12-02 15:27:57 | [diff] [blame] | 21 | 'dependencies': [ |
| 22 | 'gtest_prod', |
| 23 | ], |
[email protected] | e260ebc | 2013-12-18 05:31:33 | [diff] [blame] | 24 | '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', |
[email protected] | b6bf5c32 | 2014-08-09 05:24:02 | [diff] [blame] | 28 | # Chrome doesn't support / require C++11, yet. |
| 29 | 'GTEST_LANG_CXX11=0', |
[email protected] | e260ebc | 2013-12-18 05:31:33 | [diff] [blame] | 30 | ], |
| 31 | 'all_dependent_settings': { |
tzik | d805a40e | 2016-07-22 03:30:18 | [diff] [blame^] | 32 | 'include_dirs': [ |
| 33 | 'gtest/include', |
| 34 | ], |
[email protected] | e260ebc | 2013-12-18 05:31:33 | [diff] [blame] | 35 | 'defines': [ |
| 36 | 'GTEST_HAS_POSIX_RE=0', |
[email protected] | b6bf5c32 | 2014-08-09 05:24:02 | [diff] [blame] | 37 | 'GTEST_LANG_CXX11=0', |
[email protected] | e260ebc | 2013-12-18 05:31:33 | [diff] [blame] | 38 | ], |
| 39 | }, |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 40 | 'conditions': [ |
[email protected] | 17f7c434 | 2012-07-09 14:41:14 | [diff] [blame] | 41 | ['OS == "mac" or OS == "ios"', { |
[email protected] | 1bba09c | 2009-08-13 12:53:16 | [diff] [blame] | 42 | 'sources': [ |
[email protected] | ecebcc9 | 2010-08-06 02:39:26 | [diff] [blame] | 43 | 'gtest_mac.h', |
| 44 | 'gtest_mac.mm', |
eugenebut | a016a7e | 2015-02-04 18:15:00 | [diff] [blame] | 45 | 'platform_test_mac.mm', |
[email protected] | 1bba09c | 2009-08-13 12:53:16 | [diff] [blame] | 46 | ], |
[email protected] | c77043fc | 2009-08-20 22:37:59 | [diff] [blame] | 47 | 'link_settings': { |
| 48 | 'libraries': [ |
| 49 | '$(SDKROOT)/System/Library/Frameworks/Foundation.framework', |
| 50 | ], |
| 51 | }, |
[email protected] | 1bba09c | 2009-08-13 12:53:16 | [diff] [blame] | 52 | }], |
[email protected] | 17f7c434 | 2012-07-09 14:41:14 | [diff] [blame] | 53 | ['OS == "ios"', { |
[email protected] | 57871bc | 2012-08-20 16:28:12 | [diff] [blame] | 54 | 'dependencies' : [ |
[email protected] | 296bc45 | 2013-05-13 21:29:47 | [diff] [blame] | 55 | '<(DEPTH)/testing/iossim/iossim.gyp:iossim#host', |
[email protected] | 57871bc | 2012-08-20 16:28:12 | [diff] [blame] | 56 | ], |
[email protected] | 17f7c434 | 2012-07-09 14:41:14 | [diff] [blame] | 57 | 'direct_dependent_settings': { |
| 58 | 'target_conditions': [ |
| 59 | # Turn all tests into bundles on iOS because that's the only |
| 60 | # type of executable supported for iOS. |
| 61 | ['_type=="executable"', { |
| 62 | 'variables': { |
| 63 | # Use a variable so the path gets fixed up so it is always |
| 64 | # correct when INFOPLIST_FILE finally gets set. |
| 65 | 'ios_unittest_info_plist_path': |
| 66 | '<(DEPTH)/testing/gtest_ios/unittest-Info.plist', |
| 67 | }, |
| 68 | 'mac_bundle': 1, |
| 69 | 'xcode_settings': { |
sdefresne | 727206c6 | 2016-07-13 14:40:30 | [diff] [blame] | 70 | 'BUNDLE_ID_TEST_NAME': '>(_target_name)', |
[email protected] | 17f7c434 | 2012-07-09 14:41:14 | [diff] [blame] | 71 | 'INFOPLIST_FILE': '>(ios_unittest_info_plist_path)', |
| 72 | }, |
| 73 | 'mac_bundle_resources': [ |
| 74 | '<(ios_unittest_info_plist_path)', |
rohitrao | d2f3488 | 2014-10-08 19:25:31 | [diff] [blame] | 75 | '<(DEPTH)/testing/gtest_ios/Default.png', |
[email protected] | 17f7c434 | 2012-07-09 14:41:14 | [diff] [blame] | 76 | ], |
| 77 | 'mac_bundle_resources!': [ |
| 78 | '<(ios_unittest_info_plist_path)', |
| 79 | ], |
| 80 | }], |
| 81 | ], |
| 82 | }, |
[email protected] | 9b00523e | 2014-07-10 00:41:02 | [diff] [blame] | 83 | 'sources': [ |
| 84 | 'coverage_util_ios.cc', |
| 85 | 'coverage_util_ios.h', |
[email protected] | 9b00523e | 2014-07-10 00:41:02 | [diff] [blame] | 86 | ], |
[email protected] | 17f7c434 | 2012-07-09 14:41:14 | [diff] [blame] | 87 | }], |
[email protected] | a22906d | 2013-07-03 08:26:51 | [diff] [blame] | 88 | ['OS=="ios" and asan==1', { |
| 89 | 'direct_dependent_settings': { |
| 90 | 'target_conditions': [ |
| 91 | # Package the ASan runtime dylib into the test app bundles. |
| 92 | ['_type=="executable"', { |
| 93 | 'postbuilds': [ |
| 94 | { |
| 95 | 'variables': { |
| 96 | # Define copy_asan_dylib_path in a variable ending in |
| 97 | # _path so that gyp understands it's a path and |
| 98 | # performs proper relativization during dict merging. |
| 99 | 'copy_asan_dylib_path': |
| 100 | '<(DEPTH)/build/mac/copy_asan_runtime_dylib.sh', |
| 101 | }, |
| 102 | 'postbuild_name': 'Copy ASan runtime dylib', |
| 103 | 'action': [ |
[email protected] | a5963c5 | 2013-07-09 14:19:27 | [diff] [blame] | 104 | '>(copy_asan_dylib_path)', |
[email protected] | a22906d | 2013-07-03 08:26:51 | [diff] [blame] | 105 | ], |
| 106 | }, |
| 107 | ], |
| 108 | }], |
| 109 | ], |
| 110 | }, |
| 111 | }], |
[email protected] | f5c7758a | 2012-07-25 16:17:57 | [diff] [blame] | 112 | ['OS=="android" and android_app_abi=="x86"', { |
| 113 | 'defines': [ |
| 114 | 'GTEST_HAS_CLONE=0', |
| 115 | ], |
| 116 | 'direct_dependent_settings': { |
| 117 | 'defines': [ |
| 118 | 'GTEST_HAS_CLONE=0', |
| 119 | ], |
| 120 | }, |
| 121 | }], |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 122 | ], |
| 123 | 'direct_dependent_settings': { |
| 124 | 'defines': [ |
| 125 | 'UNIT_TEST', |
| 126 | ], |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 127 | 'target_conditions': [ |
[email protected] | 8855583 | 2010-12-17 16:04:03 | [diff] [blame] | 128 | ['_type=="executable"', { |
| 129 | 'test': 1, |
| 130 | 'conditions': [ |
| 131 | ['OS=="mac"', { |
| 132 | 'run_as': { |
| 133 | 'action????': ['${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}'], |
| 134 | }, |
| 135 | }], |
[email protected] | 17f7c434 | 2012-07-09 14:41:14 | [diff] [blame] | 136 | ['OS=="ios"', { |
| 137 | 'variables': { |
| 138 | # Use a variable so the path gets fixed up so it is always |
| 139 | # correct when the action finally gets used. |
| 140 | 'ios_run_unittest_script_path': |
[email protected] | 58cddec2 | 2012-07-26 11:52:27 | [diff] [blame] | 141 | '<(DEPTH)/testing/gtest_ios/run-unittest.sh', |
[email protected] | 17f7c434 | 2012-07-09 14:41:14 | [diff] [blame] | 142 | }, |
| 143 | 'run_as': { |
| 144 | 'action????': ['>(ios_run_unittest_script_path)'], |
| 145 | }, |
| 146 | }], |
[email protected] | 8855583 | 2010-12-17 16:04:03 | [diff] [blame] | 147 | ['OS=="win"', { |
| 148 | 'run_as': { |
| 149 | 'action????': ['$(TargetPath)', '--gtest_print_time'], |
| 150 | }, |
| 151 | }], |
| 152 | ], |
| 153 | }], |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 154 | ], |
[email protected] | c836d7a0 | 2009-10-03 20:47:21 | [diff] [blame] | 155 | 'msvs_disabled_warnings': [4800], |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 156 | }, |
| 157 | }, |
[email protected] | 4b0f963 | 2009-05-06 19:13:06 | [diff] [blame] | 158 | { |
[email protected] | 016498e | 2010-12-03 00:59:23 | [diff] [blame] | 159 | 'target_name': 'gtest_main', |
[email protected] | 5a54733 | 2011-05-19 23:18:53 | [diff] [blame] | 160 | 'type': 'static_library', |
[email protected] | 4b0f963 | 2009-05-06 19:13:06 | [diff] [blame] | 161 | 'dependencies': [ |
| 162 | 'gtest', |
| 163 | ], |
| 164 | 'sources': [ |
piman | 5623da4 | 2016-07-21 03:03:15 | [diff] [blame] | 165 | 'gtest/src/gtest_main.cc', |
[email protected] | 4b0f963 | 2009-05-06 19:13:06 | [diff] [blame] | 166 | ], |
| 167 | }, |
[email protected] | f30ef80 | 2011-12-02 15:27:57 | [diff] [blame] | 168 | { |
| 169 | 'target_name': 'gtest_prod', |
| 170 | 'toolsets': ['host', 'target'], |
| 171 | 'type': 'none', |
| 172 | 'sources': [ |
| 173 | 'gtest/include/gtest/gtest_prod.h', |
| 174 | ], |
| 175 | }, |
[email protected] | 2f80c31 | 2009-02-25 21:26:55 | [diff] [blame] | 176 | ], |
| 177 | } |