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