Fix compile issues in ExtensionError to bump compiler.
[chromium-blink-merge.git] / ipc / BUILD.gn
blobb756921e7ddc18e87f02e4a8fa3b2a86be9d3182
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_common.cc",
12     "ipc_channel_factory.cc",
13     "ipc_channel_factory.h",
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_posix.cc",
46     "ipc_platform_file_attachment_posix.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.cc",
73       "ipc_channel_posix.cc",
74       "unix_domain_socket_util.cc",
75     ]
76   } else {
77     sources -= [
78       "ipc_channel_nacl.cc",
79       "ipc_channel_nacl.h",
80     ]
81   }
83   if (is_win || is_ios) {
84     sources -= [ "unix_domain_socket_util.cc" ]
85   }
87   defines = [ "IPC_IMPLEMENTATION" ]
89   deps = [
90     "//base",
92     # TODO(viettrungluu): Needed for base/lazy_instance.h, which is suspect.
93     "//base/third_party/dynamic_annotations",
94   ]
97 # TODO(GYP): crbug.com/360936. Get this to build and run on Android.
98 if (!is_android) {
99   test("ipc_tests") {
100     sources = [
101       "ipc_channel_posix_unittest.cc",
102       "ipc_channel_unittest.cc",
103       "ipc_fuzzing_tests.cc",
104       "ipc_message_attachment_set_posix_unittest.cc",
105       "ipc_message_unittest.cc",
106       "ipc_message_utils_unittest.cc",
107       "ipc_send_fds_test.cc",
108       "ipc_sync_channel_unittest.cc",
109       "ipc_sync_message_unittest.cc",
110       "ipc_sync_message_unittest.h",
111       "sync_socket_unittest.cc",
112       "unix_domain_socket_util_unittest.cc",
113     ]
115     if (is_win || is_ios) {
116       sources -= [ "unix_domain_socket_util_unittest.cc" ]
117     }
119     # TODO(brettw) hook up Android testing.
120     #if (is_android && gtest_target_type == "shared_library") {
121     #  deps += "/testing/android/native_test.gyp:native_testNative_code"
122     #}
124     # TODO(brettw) hook up tcmalloc to this target.
125     #if (is_posix && !is_mac && !is_android) {
126     #  if (use_allocator!="none") {
127     #    deps += "/base/allocator"
128     #  }
129     #}
131     deps = [
132       ":ipc",
133       ":test_support",
134       "//base",
135       "//base:i18n",
136       "//base/test:run_all_unittests",
137       "//base/test:test_support",
138       "//testing/gtest",
139     ]
140   }
142   test("ipc_perftests") {
143     sources = [
144       "ipc_perftests.cc",
145     ]
147     # TODO(brettw) hook up Android testing.
148     #if (is_android && gtest_target_type == "shared_library") {
149     #  deps += "/testing/android/native_test.gyp:native_testNative_code"
150     #}
152     # TODO(brettw) hook up tcmalloc to this target.
153     #if (is_posix && !is_mac && !is_android) {
154     #  if (use_allocator!="none") {
155     #    deps += "//base/allocator"
156     #  }
157     #}
158     deps = [
159       ":ipc",
160       ":test_support",
161       "//base",
162       "//base:i18n",
163       "//base/test:test_support",
164       "//base/test:test_support_perf",
165       "//testing/gtest",
166     ]
167   }
170 static_library("test_support") {
171   testonly = true
172   sources = [
173     "ipc_multiprocess_test.cc",
174     "ipc_multiprocess_test.h",
175     "ipc_perftest_support.cc",
176     "ipc_perftest_support.h",
177     "ipc_security_test_util.cc",
178     "ipc_security_test_util.h",
179     "ipc_test_base.cc",
180     "ipc_test_base.h",
181     "ipc_test_channel_listener.cc",
182     "ipc_test_channel_listener.h",
183     "ipc_test_sink.cc",
184     "ipc_test_sink.h",
185   ]
186   deps = [
187     ":ipc",
188     "//base",
189     "//base/test:test_support",
190     "//testing/gtest",
191   ]