- add sources.
[platform/framework/web/crosswalk.git] / src / tools / gn / secondary / ipc / BUILD.gn
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.
4
5 component("ipc") {
6   external = true
7   sources = [
8     "file_descriptor_set_posix.cc",
9     "file_descriptor_set_posix.h",
10     "ipc_channel.cc",
11     "ipc_channel.h",
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_macros.h",
35     "ipc_message_start.h",
36     "ipc_message_utils.cc",
37     "ipc_message_utils.h",
38     "ipc_param_traits.h",
39     "ipc_platform_file.cc",
40     "ipc_platform_file.h",
41     "ipc_sender.h",
42     "ipc_switches.cc",
43     "ipc_switches.h",
44     "ipc_sync_channel.cc",
45     "ipc_sync_channel.h",
46     "ipc_sync_message.cc",
47     "ipc_sync_message.h",
48     "ipc_sync_message_filter.cc",
49     "ipc_sync_message_filter.h",
50     "param_traits_log_macros.h",
51     "param_traits_macros.h",
52     "param_traits_read_macros.h",
53     "param_traits_write_macros.h",
54     "struct_constructor_macros.h",
55     "struct_destructor_macros.h",
56     "unix_domain_socket_util.cc",
57     "unix_domain_socket_util.h",
58   ]
59
60   #if (!is_untrusted_nacl) {
61     sources -= [
62       "ipc_channel_nacl.cc",
63       "ipc_channel_nacl.h",
64     ]
65
66   if (is_win || is_ios) {
67     sources -= [
68       "ipc_channel_factory.cc",
69       "unix_domain_socket_util.cc",
70     ]
71   }
72
73   defines = [ "IPC_IMPLEMENTATION" ]
74
75   deps = [
76     "//base",
77     # TODO(viettrungluu): Needed for base/lazy_instance.h, which is suspect.
78     "//base/third_party/dynamic_annotations",
79   ]
80 }
81
82 test("ipc_tests") {
83   external = true
84   sources = [
85     "file_descriptor_set_posix_unittest.cc",
86     "ipc_channel_posix_unittest.cc",
87     "ipc_channel_unittest.cc",
88     "ipc_fuzzing_tests.cc",
89     "ipc_message_unittest.cc",
90     "ipc_message_utils_unittest.cc",
91     "ipc_send_fds_test.cc",
92     "ipc_sync_channel_unittest.cc",
93     "ipc_sync_message_unittest.cc",
94     "ipc_sync_message_unittest.h",
95     "ipc_test_base.cc",
96     "ipc_test_base.h",
97     "sync_socket_unittest.cc",
98     "unix_domain_socket_util_unittest.cc",
99   ]
100
101   if (is_win || is_ios) {
102     sources -= "unix_domain_socket_util_unittest.cc"
103   }
104   #if (is_android && gtest_target_type == "shared_library") {
105   #  deps += "/testing/android/native_test.gyp:native_testNative_code"
106   #}
107   #if (is_posix && !is_mac && !is_android) {
108   #  if (linux_use_tcmalloc) {
109   #    deps += "/base/allocator"
110   #  }
111   #}
112
113   deps = [
114     ":ipc",
115     ":test_support_ipc",
116     "//base",
117     "//base:base_i18n",
118     "//base:run_all_unittests",
119     "//base:test_support_base",
120     "//testing:gtest",
121   ]
122 }
123
124 test("ipc_perftests") {
125   external = true
126   sources = [
127     "ipc_perftests.cc",
128     "ipc_test_base.cc",
129     "ipc_test_base.h",
130   ]
131
132   #if (is_android && gtest_target_type == "shared_library") {
133   #  deps += "/testing/android/native_test.gyp:native_testNative_code"
134   #}
135   #if (is_posix && !is_mac && !is_android) {
136   #  if (linux_use_tcmalloc) {
137   #    deps += "/base/allocator"
138   #  }
139   #}
140
141   deps = [
142     ":ipc",
143     ":test_support_ipc",
144     "//base",
145     "//base:base_i18n",
146     "//base:test_support_base",
147     "//base:test_support_perf",
148     "//testing:gtest",
149   ]
150 }
151
152 static_library("test_support_ipc") {
153   external = true
154   sources = [
155     "ipc_multiprocess_test.cc",
156     "ipc_multiprocess_test.h",
157     "ipc_test_sink.cc",
158     "ipc_test_sink.h",
159   ]
160   deps = [
161     ":ipc",
162     "//base",
163     "//testing:gtest",
164   ]
165 }
166