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