ExtensionSyncService: Properly differentiate between "pending install" and "pending...
[chromium-blink-merge.git] / jingle / BUILD.gn
blob74030bca9cae5619269c37b1b84abf7fd9bd6e39
1 # Copyright 2014 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("//build/config/features.gni")
6 import("//testing/test.gni")
8 if (enable_webrtc || !is_android) {
9   jingle_includes = exec_script("//build/gypi_to_gn.py",
10                                 [ rebase_path("jingle.gypi") ],
11                                 "scope",
12                                 [ "jingle.gypi" ])
14   # GYP version: jingle/jingle.gyp:jingle_glue
15   static_library("jingle_glue") {
16     sources = jingle_includes.jingle_glue_sources
17     public_deps = [
18       "//third_party/libjingle",
19     ]
20     deps = [
21       "//base",
22       "//base/third_party/dynamic_annotations",
23       "//net",
24     ]
26     configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
27   }
29   # A library for sending and receiving peer-issued notifications.
30   # GYP version: jingle/jingle.gyp:notifier
31   static_library("notifier") {
32     sources = [
33       "notifier/base/const_communicator.h",
34       "notifier/base/gaia_constants.cc",
35       "notifier/base/gaia_constants.h",
36       "notifier/base/gaia_token_pre_xmpp_auth.cc",
37       "notifier/base/gaia_token_pre_xmpp_auth.h",
38       "notifier/base/notification_method.cc",
39       "notifier/base/notification_method.h",
40       "notifier/base/notifier_options.cc",
41       "notifier/base/notifier_options.h",
42       "notifier/base/notifier_options_util.cc",
43       "notifier/base/notifier_options_util.h",
44       "notifier/base/server_information.cc",
45       "notifier/base/server_information.h",
46       "notifier/base/weak_xmpp_client.cc",
47       "notifier/base/weak_xmpp_client.h",
48       "notifier/base/xmpp_connection.cc",
49       "notifier/base/xmpp_connection.h",
50       "notifier/communicator/connection_settings.cc",
51       "notifier/communicator/connection_settings.h",
52       "notifier/communicator/login.cc",
53       "notifier/communicator/login.h",
54       "notifier/communicator/login_settings.cc",
55       "notifier/communicator/login_settings.h",
56       "notifier/communicator/single_login_attempt.cc",
57       "notifier/communicator/single_login_attempt.h",
58       "notifier/listener/non_blocking_push_client.cc",
59       "notifier/listener/non_blocking_push_client.h",
60       "notifier/listener/notification_constants.cc",
61       "notifier/listener/notification_constants.h",
62       "notifier/listener/notification_defines.cc",
63       "notifier/listener/notification_defines.h",
64       "notifier/listener/push_client.cc",
65       "notifier/listener/push_client.h",
66       "notifier/listener/push_client_observer.cc",
67       "notifier/listener/push_client_observer.h",
68       "notifier/listener/push_notifications_listen_task.cc",
69       "notifier/listener/push_notifications_listen_task.h",
70       "notifier/listener/push_notifications_send_update_task.cc",
71       "notifier/listener/push_notifications_send_update_task.h",
72       "notifier/listener/push_notifications_subscribe_task.cc",
73       "notifier/listener/push_notifications_subscribe_task.h",
74       "notifier/listener/send_ping_task.cc",
75       "notifier/listener/send_ping_task.h",
76       "notifier/listener/xml_element_util.cc",
77       "notifier/listener/xml_element_util.h",
78       "notifier/listener/xmpp_push_client.cc",
79       "notifier/listener/xmpp_push_client.h",
80     ]
81     defines = [ "_CRT_SECURE_NO_WARNINGS" ]
83     public_deps = [
84       "//third_party/libjingle",
85     ]
86     deps = [
87       "//base",
88       "//net",
89       "//third_party/expat",
90       "//url",
91       ":jingle_glue",
92     ]
93   }
95   # GYP version: jingle/jingle.gyp:notifier_test_util
96   static_library("notifier_test_util") {
97     testonly = true
98     sources = [
99       "notifier/base/fake_base_task.cc",
100       "notifier/base/fake_base_task.h",
101       "notifier/listener/fake_push_client.cc",
102       "notifier/listener/fake_push_client.h",
103       "notifier/listener/fake_push_client_observer.cc",
104       "notifier/listener/fake_push_client_observer.h",
105     ]
106     public_deps = [
107       ":jingle_glue",
108       ":notifier",
109     ]
110     deps = [
111       "//base",
112       "//testing/gmock",
113     ]
114   }
116   # TODO(GYP): Delete this after we've converted everything to GN.
117   # The _run targets exist only for compatibility w/ GYP.
118   group("jingle_unittests_run") {
119     testonly = true
120     deps = [
121       ":jingle_unittests",
122     ]
123   }
125   # GYP version: jingle/jingle.gyp:jingle_unittests
126   test("jingle_unittests") {
127     sources = [
128       "glue/chrome_async_socket_unittest.cc",
129       "glue/fake_ssl_client_socket_unittest.cc",
130       "glue/jingle_glue_mock_objects.cc",
131       "glue/jingle_glue_mock_objects.h",
132       "glue/logging_unittest.cc",
133       "glue/mock_task.cc",
134       "glue/mock_task.h",
135       "glue/proxy_resolving_client_socket_unittest.cc",
136       "glue/task_pump_unittest.cc",
137       "glue/thread_wrapper_unittest.cc",
138       "notifier/base/weak_xmpp_client_unittest.cc",
139       "notifier/base/xmpp_connection_unittest.cc",
140       "notifier/communicator/connection_settings_unittest.cc",
141       "notifier/communicator/login_settings_unittest.cc",
142       "notifier/communicator/single_login_attempt_unittest.cc",
143       "notifier/listener/non_blocking_push_client_unittest.cc",
144       "notifier/listener/notification_defines_unittest.cc",
145       "notifier/listener/push_client_unittest.cc",
146       "notifier/listener/push_notifications_send_update_task_unittest.cc",
147       "notifier/listener/push_notifications_subscribe_task_unittest.cc",
148       "notifier/listener/send_ping_task_unittest.cc",
149       "notifier/listener/xml_element_util_unittest.cc",
150       "notifier/listener/xmpp_push_client_unittest.cc",
151     ]
153     if (is_android) {
154       sources -= [
155         # TODO(jrg):
156         # EXPECT_DEBUG_DEATH() uses features not enabled.
157         # Should we -std=c++0x or -std=gnu++0x?
158         "glue/chrome_async_socket_unittest.cc",
159         "notifier/base/xmpp_connection_unittest.cc",
160       ]
161     }
163     configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
165     public_deps = [
166       "//third_party/libjingle",
167     ]
168     deps = [
169       ":jingle_glue",
170       ":notifier",
171       ":notifier_test_util",
172       "//base",
173       "//base/test:run_all_unittests",
174       "//base/test:test_support",
175       "//net",
176       "//net:test_support",
177       "//testing/gmock",
178       "//testing/gtest",
179     ]
180   }
181 } else {
182   # !enable_webrtc and is_android
183   # Stub targets as Android doesn't use libjingle when webrtc is disabled.
184   source_set("jingle_glue") {
185   }
187   source_set("jingle_glue_test_util") {
188   }
190   # GYP version: jingle/jingle.gyp:notifier
191   static_library("notifier") {
192     sources = [
193       "notifier/base/gaia_constants.cc",
194       "notifier/base/gaia_constants.h",
195       "notifier/base/notification_method.cc",
196       "notifier/base/notification_method.h",
197       "notifier/base/notifier_options.cc",
198       "notifier/base/notifier_options.h",
199     ]
200     deps = [
201       "//base",
202       "//net",
203     ]
204   }
206   source_set("notifier_test_util") {
207   }