Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / v8 / testing / gtest.gyp
1 # Copyright 2014 the V8 project authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 {
6   'targets': [
7     {
8       'target_name': 'gtest',
9       'toolsets': ['host', 'target'],
10       'type': 'static_library',
11       'sources': [
12         'gtest/include/gtest/gtest-death-test.h',
13         'gtest/include/gtest/gtest-message.h',
14         'gtest/include/gtest/gtest-param-test.h',
15         'gtest/include/gtest/gtest-printers.h',
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',
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',
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',
36         'gtest/src/gtest-printers.cc',
37         'gtest/src/gtest-test-part.cc',
38         'gtest/src/gtest-typed-test.cc',
39         'gtest/src/gtest.cc',
40       ],
41       'sources!': [
42         'gtest/src/gtest-all.cc',  # Not needed by our build.
43       ],
44       'include_dirs': [
45         'gtest',
46         'gtest/include',
47       ],
48       'dependencies': [
49         'gtest_prod',
50       ],
51       'defines': [
52         # In order to allow regex matches in gtest to be shared between Windows
53         # and other systems, we tell gtest to always use it's internal engine.
54         'GTEST_HAS_POSIX_RE=0',
55         # Chrome doesn't support / require C++11, yet.
56         'GTEST_LANG_CXX11=0',
57       ],
58       'all_dependent_settings': {
59         'defines': [
60           'GTEST_HAS_POSIX_RE=0',
61           'GTEST_LANG_CXX11=0',
62         ],
63       },
64       'conditions': [
65         ['os_posix == 1', {
66           'defines': [
67             # gtest isn't able to figure out when RTTI is disabled for gcc
68             # versions older than 4.3.2, and assumes it's enabled.  Our Mac
69             # and Linux builds disable RTTI, and cannot guarantee that the
70             # compiler will be 4.3.2. or newer.  The Mac, for example, uses
71             # 4.2.1 as that is the latest available on that platform.  gtest
72             # must be instructed that RTTI is disabled here, and for any
73             # direct dependents that might include gtest headers.
74             'GTEST_HAS_RTTI=0',
75           ],
76           'direct_dependent_settings': {
77             'defines': [
78               'GTEST_HAS_RTTI=0',
79             ],
80           },
81         }],
82         ['OS=="android"', {
83           'defines': [
84             'GTEST_HAS_CLONE=0',
85           ],
86           'direct_dependent_settings': {
87             'defines': [
88               'GTEST_HAS_CLONE=0',
89             ],
90           },
91         }],
92         ['OS=="android"', {
93           # We want gtest features that use tr1::tuple, but we currently
94           # don't support the variadic templates used by libstdc++'s
95           # implementation. gtest supports this scenario by providing its
96           # own implementation but we must opt in to it.
97           'defines': [
98             'GTEST_USE_OWN_TR1_TUPLE=1',
99             # GTEST_USE_OWN_TR1_TUPLE only works if GTEST_HAS_TR1_TUPLE is set.
100             # gtest r625 made it so that GTEST_HAS_TR1_TUPLE is set to 0
101             # automatically on android, so it has to be set explicitly here.
102             'GTEST_HAS_TR1_TUPLE=1',
103           ],
104           'direct_dependent_settings': {
105             'defines': [
106               'GTEST_USE_OWN_TR1_TUPLE=1',
107               'GTEST_HAS_TR1_TUPLE=1',
108             ],
109           },
110         }],
111       ],
112       'direct_dependent_settings': {
113         'defines': [
114           'UNIT_TEST',
115         ],
116         'include_dirs': [
117           'gtest/include',  # So that gtest headers can find themselves.
118         ],
119         'target_conditions': [
120           ['_type=="executable"', {
121             'test': 1,
122             'conditions': [
123               ['OS=="mac"', {
124                 'run_as': {
125                   'action????': ['${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}'],
126                 },
127               }],
128               ['OS=="win"', {
129                 'run_as': {
130                   'action????': ['$(TargetPath)', '--gtest_print_time'],
131                 },
132               }],
133             ],
134           }],
135         ],
136         'msvs_disabled_warnings': [4800],
137       },
138     },
139     {
140       'target_name': 'gtest_main',
141       'type': 'static_library',
142       'dependencies': [
143         'gtest',
144       ],
145       'sources': [
146         'gtest/src/gtest_main.cc',
147       ],
148     },
149     {
150       'target_name': 'gtest_prod',
151       'toolsets': ['host', 'target'],
152       'type': 'none',
153       'sources': [
154         'gtest/include/gtest/gtest_prod.h',
155       ],
156     },
157   ],
158 }