Port Android relocation packer to chromium build
[chromium-blink-merge.git] / components / sessions / BUILD.gn
blob4cf5709d76e7a86c3d5a56b21dd392e14a2b6ebe
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 if (is_android) {
6   import("//build/config/android/config.gni")
9 # TODO(rohitrao): sessions_core is defined as a source_set because it declares a
10 # static function that it does not define.  This prevents it from linking as a
11 # shared_library.  It also cannot be a static_library because it will be linked
12 # into multiple shared libraries.  Revisit this setup if necessary.
13 source_set("sessions_core") {
14   sources = [
15     "base_session_service.cc",
16     "base_session_service.h",
17     "base_session_service_commands.cc",
18     "base_session_service_commands.h",
19     "base_session_service_delegate.h",
20     "core/serialized_navigation_driver.h",
21     "serialized_navigation_entry.cc",
22     "serialized_navigation_entry.h",
23     "session_backend.cc",
24     "session_backend.h",
25     "session_command.cc",
26     "session_command.h",
27     "session_id.cc",
28     "session_id.h",
29     "session_service_commands.cc",
30     "session_service_commands.h",
31     "session_types.cc",
32     "session_types.h",
33   ]
35   defines = [ "SESSIONS_IMPLEMENTATION" ]
37   deps = [
38     "//base",
39     "//skia",
40     "//third_party/protobuf:protobuf_lite",
41     "//ui/base",
42     "//ui/gfx",
43     "//url",
44   ]
46   if (!is_android || !is_android_webview_build) {
47     deps += [ "//sync" ]
48   }
51 source_set("test_support") {
52   testonly = true
53   sources = [
54     "serialized_navigation_entry_test_helper.cc",
55     "serialized_navigation_entry_test_helper.h",
56   ]
58   deps = [
59     ":sessions_core",
60     "//skia",
61     "//testing/gtest",
62   ]
64   if (!is_android || !is_android_webview_build) {
65     deps += [ "//sync" ]
66   }
68   if (!is_android && !is_ios) {
69     sources += [
70       "base_session_service_test_helper.cc",
71       "base_session_service_test_helper.h",
72     ]
73   }
76 if (!is_ios) {
77   component("sessions_content") {
78     sources = [
79       "content/content_serialized_navigation_builder.cc",
80       "content/content_serialized_navigation_builder.h",
81       "content/content_serialized_navigation_driver.cc",
82       "content/content_serialized_navigation_driver.h",
83     ]
85     defines = [ "SESSIONS_IMPLEMENTATION" ]
87     deps = [
88       ":sessions_core",
89       "//base",
90       "//base/third_party/dynamic_annotations",
91       "//content/public/browser",
92       "//ui/base",
93       "//url",
94     ]
95   }
98 if (!is_ios && !is_android) {
99   source_set("unit_tests") {
100     testonly = true
101     sources = [
102       "session_backend_unittest.cc",
103       "session_types_unittest.cc",
104     ]
105     deps = [
106       ":sessions_content",
107       "//base/test:test_support",
108       "//testing/gtest",
109       "//third_party/protobuf:protobuf_lite",
110     ]
111   }