Roll ANGLE cc54ab3..c5b2ba5
[chromium-blink-merge.git] / components / gcm_driver / BUILD.gn
blobe80ac0afa4a955c4a548fb3edf2f5491e79f73e6
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 # GYP version: components/gcm_driver.gypi:gcm_driver
6 static_library("gcm_driver") {
7   sources = [
8     "android/component_jni_registrar.cc",
9     "android/component_jni_registrar.h",
10     "default_gcm_app_handler.cc",
11     "default_gcm_app_handler.h",
12     "gcm_account_mapper.cc",
13     "gcm_account_mapper.h",
14     "gcm_account_tracker.cc",
15     "gcm_account_tracker.h",
16     "gcm_activity.cc",
17     "gcm_activity.h",
18     "gcm_app_handler.cc",
19     "gcm_app_handler.h",
20     "gcm_backoff_policy.cc",
21     "gcm_backoff_policy.h",
22     "gcm_channel_status_request.cc",
23     "gcm_channel_status_request.h",
24     "gcm_channel_status_syncer.cc",
25     "gcm_channel_status_syncer.h",
26     "gcm_client.cc",
27     "gcm_client.h",
28     "gcm_client_factory.cc",
29     "gcm_client_factory.h",
30     "gcm_client_impl.cc",
31     "gcm_client_impl.h",
32     "gcm_connection_observer.cc",
33     "gcm_connection_observer.h",
34     "gcm_delayed_task_controller.cc",
35     "gcm_delayed_task_controller.h",
36     "gcm_driver.cc",
37     "gcm_driver.h",
38     "gcm_driver_android.cc",
39     "gcm_driver_android.h",
40     "gcm_driver_desktop.cc",
41     "gcm_driver_desktop.h",
42     "gcm_internals_constants.cc",
43     "gcm_internals_constants.h",
44     "gcm_stats_recorder_impl.cc",
45     "gcm_stats_recorder_impl.h",
46     "registration_info.cc",
47     "registration_info.h",
48     "system_encryptor.cc",
49     "system_encryptor.h",
50   ]
52   deps = [
53     "crypto",
54     "//base",
55     "//components/gcm_driver/common",
56     "//components/os_crypt",
57     "//google_apis/gcm",
58     "//net",
59     "//sync/protocol",
60   ]
62   if (is_chromeos) {
63     deps += [ "//components/timers" ]
64   }
66   if (is_android) {
67     sources -= [
68       "gcm_account_mapper.cc",
69       "gcm_account_mapper.h",
70       "gcm_channel_status_request.cc",
71       "gcm_channel_status_request.h",
72       "gcm_channel_status_syncer.cc",
73       "gcm_channel_status_syncer.h",
74       "gcm_client_factory.cc",
75       "gcm_client_factory.h",
76       "gcm_client_impl.cc",
77       "gcm_client_impl.h",
78       "gcm_driver_desktop.cc",
79       "gcm_driver_desktop.h",
80       "gcm_stats_recorder_impl.cc",
81       "gcm_stats_recorder_impl.h",
82     ]
83     deps -= [ "//google_apis/gcm" ]
84     deps += [ "android:jni_headers" ]
85   }
88 # GYP version: components/gcm_driver.gypi:gcm_driver_test_support
89 static_library("test_support") {
90   testonly = true
91   sources = [
92     "fake_gcm_app_handler.cc",
93     "fake_gcm_app_handler.h",
94     "fake_gcm_client.cc",
95     "fake_gcm_client.h",
96     "fake_gcm_client_factory.cc",
97     "fake_gcm_client_factory.h",
98     "fake_gcm_driver.cc",
99     "fake_gcm_driver.h",
100   ]
102   deps = [
103     ":gcm_driver",
104     "//base",
105     "//google_apis/gcm:test_support",
106     "//testing/gtest",
107   ]
109   if (is_android) {
110     sources -= [
111       "fake_gcm_client.cc",
112       "fake_gcm_client.h",
113       "fake_gcm_client_factory.cc",
114       "fake_gcm_client_factory.h",
115     ]
116     deps -= [ "//google_apis/gcm:test_support" ]
117   }
120 if (!is_android) {
121   source_set("unit_tests") {
122     testonly = true
123     sources = [
124       "gcm_account_mapper_unittest.cc",
125       "gcm_account_tracker_unittest.cc",
126       "gcm_channel_status_request_unittest.cc",
127       "gcm_client_impl_unittest.cc",
128       "gcm_delayed_task_controller_unittest.cc",
129       "gcm_driver_desktop_unittest.cc",
130       "gcm_stats_recorder_impl_unittest.cc",
131     ]
133     deps = [
134       ":gcm_driver",
135       ":test_support",
136       "//testing/gtest",
137       "//third_party/protobuf:protobuf_lite",
138     ]
139   }