OLD | NEW |
1 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 { | 5 { |
6 'targets': [ | 6 'targets': [ |
7 { | 7 { |
8 'target_name': 'gtest', | 8 'target_name': 'gtest', |
9 'type': 'static_library', | 9 'type': 'static_library', |
10 'sources': [ | 10 'sources': [ |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 'gtest/src/gtest-all.cc', # Not needed by our build. | 44 'gtest/src/gtest-all.cc', # Not needed by our build. |
45 ], | 45 ], |
46 'include_dirs': [ | 46 'include_dirs': [ |
47 'gtest', | 47 'gtest', |
48 'gtest/include', | 48 'gtest/include', |
49 ], | 49 ], |
50 'dependencies': [ | 50 'dependencies': [ |
51 'gtest_prod', | 51 'gtest_prod', |
52 ], | 52 ], |
53 'conditions': [ | 53 'conditions': [ |
54 ['OS == "mac"', { | 54 ['OS == "mac" or OS == "ios"', { |
55 'sources': [ | 55 'sources': [ |
56 'gtest_mac.h', | 56 'gtest_mac.h', |
57 'gtest_mac.mm', | 57 'gtest_mac.mm', |
58 'platform_test_mac.mm' | 58 'platform_test_mac.mm' |
59 ], | 59 ], |
60 'link_settings': { | 60 'link_settings': { |
61 'libraries': [ | 61 'libraries': [ |
62 '$(SDKROOT)/System/Library/Frameworks/Foundation.framework', | 62 '$(SDKROOT)/System/Library/Frameworks/Foundation.framework', |
63 ], | 63 ], |
64 }, | 64 }, |
65 }], | 65 }], |
| 66 ['OS == "ios"', { |
| 67 'direct_dependent_settings': { |
| 68 'target_conditions': [ |
| 69 # Turn all tests into bundles on iOS because that's the only |
| 70 # type of executable supported for iOS. |
| 71 ['_type=="executable"', { |
| 72 'variables': { |
| 73 # Use a variable so the path gets fixed up so it is always |
| 74 # correct when INFOPLIST_FILE finally gets set. |
| 75 'ios_unittest_info_plist_path': |
| 76 '<(DEPTH)/testing/gtest_ios/unittest-Info.plist', |
| 77 }, |
| 78 'mac_bundle': 1, |
| 79 'xcode_settings': { |
| 80 'BUNDLE_ID_TEST_NAME': |
| 81 '>!(echo ">(_target_name)" | sed -e "s/_//g")', |
| 82 'INFOPLIST_FILE': '>(ios_unittest_info_plist_path)', |
| 83 }, |
| 84 'mac_bundle_resources': [ |
| 85 '<(ios_unittest_info_plist_path)', |
| 86 ], |
| 87 'mac_bundle_resources!': [ |
| 88 '<(ios_unittest_info_plist_path)', |
| 89 ], |
| 90 }], |
| 91 ], |
| 92 }, |
| 93 }], |
66 ['os_posix == 1', { | 94 ['os_posix == 1', { |
67 'defines': [ | 95 'defines': [ |
68 # gtest isn't able to figure out when RTTI is disabled for gcc | 96 # gtest isn't able to figure out when RTTI is disabled for gcc |
69 # versions older than 4.3.2, and assumes it's enabled. Our Mac | 97 # versions older than 4.3.2, and assumes it's enabled. Our Mac |
70 # and Linux builds disable RTTI, and cannot guarantee that the | 98 # and Linux builds disable RTTI, and cannot guarantee that the |
71 # compiler will be 4.3.2. or newer. The Mac, for example, uses | 99 # compiler will be 4.3.2. or newer. The Mac, for example, uses |
72 # 4.2.1 as that is the latest available on that platform. gtest | 100 # 4.2.1 as that is the latest available on that platform. gtest |
73 # must be instructed that RTTI is disabled here, and for any | 101 # must be instructed that RTTI is disabled here, and for any |
74 # direct dependents that might include gtest headers. | 102 # direct dependents that might include gtest headers. |
75 'GTEST_HAS_RTTI=0', | 103 'GTEST_HAS_RTTI=0', |
(...skipping 28 matching lines...) Expand all Loading... |
104 ], | 132 ], |
105 'target_conditions': [ | 133 'target_conditions': [ |
106 ['_type=="executable"', { | 134 ['_type=="executable"', { |
107 'test': 1, | 135 'test': 1, |
108 'conditions': [ | 136 'conditions': [ |
109 ['OS=="mac"', { | 137 ['OS=="mac"', { |
110 'run_as': { | 138 'run_as': { |
111 'action????': ['${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}'], | 139 'action????': ['${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}'], |
112 }, | 140 }, |
113 }], | 141 }], |
| 142 ['OS=="ios"', { |
| 143 'variables': { |
| 144 # Use a variable so the path gets fixed up so it is always |
| 145 # correct when the action finally gets used. |
| 146 'ios_run_unittest_script_path': |
| 147 '<(DEPTH)/testing/gtest_ios/RunUnittest.sh', |
| 148 }, |
| 149 'run_as': { |
| 150 'action????': ['>(ios_run_unittest_script_path)'], |
| 151 }, |
| 152 }], |
114 ['OS=="win"', { | 153 ['OS=="win"', { |
115 'run_as': { | 154 'run_as': { |
116 'action????': ['$(TargetPath)', '--gtest_print_time'], | 155 'action????': ['$(TargetPath)', '--gtest_print_time'], |
117 }, | 156 }, |
118 }], | 157 }], |
119 ], | 158 ], |
120 }], | 159 }], |
121 ], | 160 ], |
122 'msvs_disabled_warnings': [4800], | 161 'msvs_disabled_warnings': [4800], |
123 }, | 162 }, |
(...skipping 11 matching lines...) Expand all Loading... |
135 { | 174 { |
136 'target_name': 'gtest_prod', | 175 'target_name': 'gtest_prod', |
137 'toolsets': ['host', 'target'], | 176 'toolsets': ['host', 'target'], |
138 'type': 'none', | 177 'type': 'none', |
139 'sources': [ | 178 'sources': [ |
140 'gtest/include/gtest/gtest_prod.h', | 179 'gtest/include/gtest/gtest_prod.h', |
141 ], | 180 ], |
142 }, | 181 }, |
143 ], | 182 ], |
144 } | 183 } |
OLD | NEW |