Obey renderer-supplied quota in the browser.
[chromium-blink-merge.git] / ipc / ipc.gyp
blob0546debbd5b2c2bf84b7eaaebac25ba3b48976fb
1 # Copyright (c) 2012 The Chromium 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.
6   'variables': {
7     'chromium_code': 1,
8   },
9   'includes': [
10     'ipc.gypi',
11   ],
12   'targets': [
13     {
14       'target_name': 'ipc',
15       'type': '<(component)',
16       'variables': {
17         'ipc_target': 1,
18       },
19       'dependencies': [
20         '../base/base.gyp:base',
21         # TODO(viettrungluu): Needed for base/lazy_instance.h, which is suspect.
22         '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
23       ],
24       # TODO(gregoryd): direct_dependent_settings should be shared with the
25       # 64-bit target, but it doesn't work due to a bug in gyp
26       'direct_dependent_settings': {
27         'include_dirs': [
28           '..',
29         ],
30       },
31     },
32     {
33       'target_name': 'ipc_tests',
34       'type': '<(gtest_target_type)',
35       'dependencies': [
36         'ipc',
37         'test_support_ipc',
38         '../base/base.gyp:base',
39         '../base/base.gyp:base_i18n',
40         '../base/base.gyp:test_support_base',
41         '../testing/gtest.gyp:gtest',
42       ],
43       'include_dirs': [
44         '..'
45       ],
46       'sources': [
47         'file_descriptor_set_posix_unittest.cc',
48         'ipc_channel_posix_unittest.cc',
49         'ipc_channel_proxy_unittest.cc',
50         'ipc_channel_unittest.cc',
51         'ipc_fuzzing_tests.cc',
52         'ipc_message_unittest.cc',
53         'ipc_message_utils_unittest.cc',
54         'ipc_send_fds_test.cc',
55         'ipc_sync_channel_unittest.cc',
56         'ipc_sync_message_unittest.cc',
57         'ipc_sync_message_unittest.h',
58         'ipc_test_base.cc',
59         'ipc_test_base.h',
60         'run_all_unittests.cc',
61         'sync_socket_unittest.cc',
62         'unix_domain_socket_util_unittest.cc',
63       ],
64       'conditions': [
65         ['toolkit_uses_gtk == 1', {
66           'dependencies': [
67             '../build/linux/system.gyp:gtk',
68           ],
69         }],
70         ['OS == "win" or OS == "ios"', {
71           'sources!': [
72             'unix_domain_socket_util_unittest.cc',
73           ],
74         }],
75         ['OS == "android" and gtest_target_type == "shared_library"', {
76           'dependencies': [
77             '../testing/android/native_test.gyp:native_test_native_code',
78           ],
79         }],
80         ['os_posix == 1 and OS != "mac" and OS != "android"', {
81           'conditions': [
82             # TODO(dmikurube): Kill linux_use_tcmalloc. http://crbug.com/345554
83             ['(use_allocator!="none" and use_allocator!="see_use_tcmalloc") or (use_allocator=="see_use_tcmalloc" and linux_use_tcmalloc==1)', {
84               'dependencies': [
85                 '../base/allocator/allocator.gyp:allocator',
86               ],
87             }],
88           ],
89         }]
90       ],
91     },
92     {
93       'target_name': 'ipc_perftests',
94       'type': '<(gtest_target_type)',
95       # TODO(viettrungluu): Figure out which dependencies are really needed.
96       'dependencies': [
97         'ipc',
98         'test_support_ipc',
99         '../base/base.gyp:base',
100         '../base/base.gyp:base_i18n',
101         '../base/base.gyp:test_support_base',
102         '../base/base.gyp:test_support_perf',
103         '../testing/gtest.gyp:gtest',
104       ],
105       'include_dirs': [
106         '..'
107       ],
108       'sources': [
109         'ipc_perftests.cc',
110         'ipc_test_base.cc',
111         'ipc_test_base.h',
112       ],
113       'conditions': [
114         ['toolkit_uses_gtk == 1', {
115           'dependencies': [
116             '../build/linux/system.gyp:gtk',
117           ],
118         }],
119         ['OS == "android" and gtest_target_type == "shared_library"', {
120           'dependencies': [
121             '../testing/android/native_test.gyp:native_test_native_code',
122           ],
123         }],
124         ['os_posix == 1 and OS != "mac" and OS != "android"', {
125           'conditions': [
126             # TODO(dmikurube): Kill linux_use_tcmalloc. http://crbug.com/345554
127             ['(use_allocator!="none" and use_allocator!="see_use_tcmalloc") or (use_allocator=="see_use_tcmalloc" and linux_use_tcmalloc==1)', {
128               'dependencies': [
129                 '../base/allocator/allocator.gyp:allocator',
130               ],
131             }],
132           ],
133         }]
134       ],
135     },
136     {
137       'target_name': 'test_support_ipc',
138       'type': 'static_library',
139       'dependencies': [
140         'ipc',
141         '../base/base.gyp:base',
142         '../testing/gtest.gyp:gtest',
143       ],
144       'sources': [
145         'ipc_multiprocess_test.cc',
146         'ipc_multiprocess_test.h',
147         'ipc_test_sink.cc',
148         'ipc_test_sink.h',
149       ],
150     },
151   ],
152   'conditions': [
153     ['OS=="win" and target_arch=="ia32"', {
154       'targets': [
155         {
156           'target_name': 'ipc_win64',
157           'type': '<(component)',
158           'variables': {
159             'ipc_target': 1,
160           },
161           'dependencies': [
162             '../base/base.gyp:base_win64',
163             # TODO(viettrungluu): Needed for base/lazy_instance.h, which is
164             # suspect.
165             '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations_win64',
166           ],
167           # TODO(gregoryd): direct_dependent_settings should be shared with the
168           # 32-bit target, but it doesn't work due to a bug in gyp
169           'direct_dependent_settings': {
170             'include_dirs': [
171               '..',
172             ],
173           },
174           'configurations': {
175             'Common_Base': {
176               'msvs_target_platform': 'x64',
177             },
178           },
179         },
180       ],
181     }],
182     # Special target to wrap a gtest_target_type==shared_library
183     # ipc_tests into an android apk for execution.
184     # See base.gyp for TODO(jrg)s about this strategy.
185     ['OS == "android" and gtest_target_type == "shared_library"', {
186       'targets': [
187         {
188           'target_name': 'ipc_tests_apk',
189           'type': 'none',
190           'dependencies': [
191             'ipc_tests',
192           ],
193           'variables': {
194             'test_suite_name': 'ipc_tests',
195             'input_shlib_path': '<(SHARED_LIB_DIR)/<(SHARED_LIB_PREFIX)ipc_tests<(SHARED_LIB_SUFFIX)',
196           },
197           'includes': [ '../build/apk_test.gypi' ],
198         },
199         {
200           'target_name': 'ipc_perftests_apk',
201           'type': 'none',
202           'dependencies': [
203             'ipc_perftests',
204           ],
205           'variables': {
206             'test_suite_name': 'ipc_perftests',
207             'input_shlib_path': '<(SHARED_LIB_DIR)/<(SHARED_LIB_PREFIX)ipc_perftests<(SHARED_LIB_SUFFIX)',
208           },
209           'includes': [ '../build/apk_test.gypi' ],
210         }],
211     }],
212   ],