Roll src/third_party/WebKit 3de3302:4cf36d6 (svn 198021:198025)
[chromium-blink-merge.git] / ipc / BUILD.gn
blobf5f65950e78f9e600a4ba8d98d3d5109e2481528
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.
5 import("//testing/test.gni")
7 component("ipc") {
8   sources = [
9     "attachment_broker.h",
10     "attachment_broker_win.cc",
11     "attachment_broker_win.h",
12     "brokerable_attachment.cc",
13     "brokerable_attachment.h",
14     "handle_attachment_win.h",
15     "ipc_channel.cc",
16     "ipc_channel.h",
17     "ipc_channel_common.cc",
18     "ipc_channel_factory.cc",
19     "ipc_channel_factory.h",
20     "ipc_channel_handle.h",
21     "ipc_channel_nacl.cc",
22     "ipc_channel_nacl.h",
23     "ipc_channel_posix.cc",
24     "ipc_channel_posix.h",
25     "ipc_channel_proxy.cc",
26     "ipc_channel_proxy.h",
27     "ipc_channel_reader.cc",
28     "ipc_channel_reader.h",
29     "ipc_channel_win.cc",
30     "ipc_channel_win.h",
31     "ipc_descriptors.h",
32     "ipc_export.h",
33     "ipc_forwarding_message_filter.cc",
34     "ipc_forwarding_message_filter.h",
35     "ipc_listener.h",
36     "ipc_logging.cc",
37     "ipc_logging.h",
38     "ipc_message.cc",
39     "ipc_message.h",
40     "ipc_message_attachment.cc",
41     "ipc_message_attachment.h",
42     "ipc_message_attachment_set.cc",
43     "ipc_message_attachment_set.h",
44     "ipc_message_macros.h",
45     "ipc_message_start.h",
46     "ipc_message_utils.cc",
47     "ipc_message_utils.h",
48     "ipc_param_traits.h",
49     "ipc_platform_file.cc",
50     "ipc_platform_file.h",
51     "ipc_platform_file_attachment_posix.cc",
52     "ipc_platform_file_attachment_posix.h",
53     "ipc_sender.h",
54     "ipc_switches.cc",
55     "ipc_switches.h",
56     "ipc_sync_channel.cc",
57     "ipc_sync_channel.h",
58     "ipc_sync_message.cc",
59     "ipc_sync_message.h",
60     "ipc_sync_message_filter.cc",
61     "ipc_sync_message_filter.h",
62     "message_filter.cc",
63     "message_filter.h",
64     "message_filter_router.cc",
65     "message_filter_router.h",
66     "param_traits_log_macros.h",
67     "param_traits_macros.h",
68     "param_traits_read_macros.h",
69     "param_traits_write_macros.h",
70     "struct_constructor_macros.h",
71     "struct_destructor_macros.h",
72     "unix_domain_socket_util.cc",
73     "unix_domain_socket_util.h",
74   ]
76   if (is_nacl) {
77     sources -= [
78       "ipc_channel.cc",
79       "ipc_channel_posix.cc",
80       "unix_domain_socket_util.cc",
81     ]
82   } else {
83     sources -= [
84       "ipc_channel_nacl.cc",
85       "ipc_channel_nacl.h",
86     ]
87   }
89   if (is_win || is_ios) {
90     sources -= [ "unix_domain_socket_util.cc" ]
91   }
93   defines = [ "IPC_IMPLEMENTATION" ]
95   deps = [
96     "//base",
98     # TODO(viettrungluu): Needed for base/lazy_instance.h, which is suspect.
99     "//base/third_party/dynamic_annotations",
100   ]
103 # TODO(GYP): crbug.com/360936. Get this to build and run on Android.
104 if (!is_android) {
105   test("ipc_tests") {
106     sources = [
107       "ipc_channel_posix_unittest.cc",
108       "ipc_channel_unittest.cc",
109       "ipc_fuzzing_tests.cc",
110       "ipc_message_attachment_set_posix_unittest.cc",
111       "ipc_message_unittest.cc",
112       "ipc_message_utils_unittest.cc",
113       "ipc_send_fds_test.cc",
114       "ipc_sync_channel_unittest.cc",
115       "ipc_sync_message_unittest.cc",
116       "ipc_sync_message_unittest.h",
117       "sync_socket_unittest.cc",
118       "unix_domain_socket_util_unittest.cc",
119     ]
121     if (is_win || is_ios) {
122       sources -= [ "unix_domain_socket_util_unittest.cc" ]
123     }
125     # TODO(brettw) hook up Android testing.
126     #if (is_android && gtest_target_type == "shared_library") {
127     #  deps += "/testing/android/native_test.gyp:native_testNative_code"
128     #}
130     # TODO(brettw) hook up tcmalloc to this target.
131     #if (is_posix && !is_mac && !is_android) {
132     #  if (use_allocator!="none") {
133     #    deps += "/base/allocator"
134     #  }
135     #}
137     deps = [
138       ":ipc",
139       ":test_support",
140       "//base",
141       "//base:i18n",
142       "//base/test:run_all_unittests",
143       "//base/test:test_support",
144       "//testing/gtest",
145     ]
146   }
148   test("ipc_perftests") {
149     sources = [
150       "ipc_perftests.cc",
151     ]
153     # TODO(brettw) hook up Android testing.
154     #if (is_android && gtest_target_type == "shared_library") {
155     #  deps += "/testing/android/native_test.gyp:native_testNative_code"
156     #}
158     # TODO(brettw) hook up tcmalloc to this target.
159     #if (is_posix && !is_mac && !is_android) {
160     #  if (use_allocator!="none") {
161     #    deps += "//base/allocator"
162     #  }
163     #}
164     deps = [
165       ":ipc",
166       ":test_support",
167       "//base",
168       "//base:i18n",
169       "//base/test:test_support",
170       "//base/test:test_support_perf",
171       "//testing/gtest",
172     ]
173   }
176 static_library("test_support") {
177   testonly = true
178   sources = [
179     "ipc_multiprocess_test.cc",
180     "ipc_multiprocess_test.h",
181     "ipc_perftest_support.cc",
182     "ipc_perftest_support.h",
183     "ipc_security_test_util.cc",
184     "ipc_security_test_util.h",
185     "ipc_test_base.cc",
186     "ipc_test_base.h",
187     "ipc_test_channel_listener.cc",
188     "ipc_test_channel_listener.h",
189     "ipc_test_sink.cc",
190     "ipc_test_sink.h",
191   ]
192   deps = [
193     ":ipc",
194     "//base",
195     "//base/test:test_support",
196     "//testing/gtest",
197   ]