Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / chrome / renderer / BUILD.gn
bloba93033838254169ac694fa8b9ccedb2169fb50ea
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("//tools/grit/grit_rule.gni")
8 gypi_values = exec_script("//build/gypi_to_gn.py",
9                           [ rebase_path("../chrome_renderer.gypi") ],
10                           "scope",
11                           [ "../chrome_renderer.gypi" ])
13 # GYP version: chrome/chrome_resources.gyp:chrome_resources
14 # (generate_renderer_resources action)
15 grit("resources") {
16   source = "resources/renderer_resources.grd"
17   output_dir = "$root_gen_dir/chrome"
18   output_name = "renderer_resources"
19   outputs = [
20     "grit/renderer_resources.h",
21     "renderer_resources_100_percent.pak",
22     "renderer_resources_200_percent.pak",
23     "renderer_resources_300_percent.pak",
24   ]
27 static_library("renderer") {
28   sources = rebase_path(gypi_values.chrome_renderer_sources, ".", "..")
30   defines = []
32   deps = [
33     "//base/allocator",
34     "//chrome/common",
35     "//chrome/common:mojo_bindings",
36     "//chrome:resources",
37     "//chrome:strings",
38     "//components/autofill/content/renderer",
39     "//components/content_settings/content/common",
40     "//components/cdm/renderer",
41     "//components/data_reduction_proxy/content/common",
42     "//components/data_reduction_proxy/core/common",
43     "//components/error_page/renderer",
44     "//components/guest_view/renderer",
45     "//components/network_hints/renderer",
46     "//components/omnibox/common",
47     "//components/page_load_metrics/renderer",
48     "//components/password_manager/content/renderer",
49     "//components/plugins/renderer",
50     "//components/printing/renderer",
51     "//components/startup_metric_utils",
52     "//components/translate/content/renderer",
53     "//components/translate/core/common",
54     "//components/translate/core/language_detection",
55     "//components/visitedlink/renderer",
56     "//components/web_cache/renderer",
57     "//content/app/resources",
58     "//content/app/strings",
59     "//content/public/renderer",
60     "//net",
61     "//skia",
62     "//storage/common",
63     "//third_party/WebKit/public:blink",
64     "//third_party/WebKit/public:image_resources",
65     "//third_party/WebKit/public:resources",
66     "//third_party/icu",
67     "//third_party/re2",
68     "//third_party/widevine/cdm:version_h",
69     "//ui/surface",
70     "//v8:v8",
71   ]
73   if (!is_ios) {
74     deps += [ "//chrome/common/net" ]
75   }
77   if (enable_nacl) {
78     deps += [
79       "//components/nacl",
80       "//components/nacl:nacl_renderer",
81     ]
82   }
84   if (enable_plugins) {
85     sources +=
86         rebase_path(gypi_values.chrome_renderer_plugin_sources, ".", "..")
87     deps += [
88       "//components/pdf/renderer",
89       "//ppapi/host",
90       "//ppapi/proxy",
91       "//ppapi/proxy:ipc",
92       "//ppapi/shared_impl",
93     ]
94   }
96   if (safe_browsing_mode != 0) {
97     sources +=
98         rebase_path(gypi_values.chrome_renderer_basic_safe_browsing_sources,
99                     ".",
100                     "..")
101     if (safe_browsing_mode == 1) {
102       sources += rebase_path(gypi_values.chrome_renderer_safe_browsing_sources,
103                              ".",
104                              "..")
105       deps += [
106         "//chrome/common/safe_browsing:proto",
107         "//third_party/smhasher:murmurhash3",
108       ]
109     }
110   }
112   if (enable_extensions) {
113     sources +=
114         rebase_path(gypi_values.chrome_renderer_extensions_sources, ".", "..")
115     deps += [
116       # TODO(hclam): See crbug.com/298380 for details.
117       # We should isolate the APIs needed by the renderer.
118       "//chrome/common/extensions/api",
119       "//extensions:extensions_resources",
120       "//extensions/renderer",
121       "//media/cast:net",
122       "//media/cast:receiver",
123       "//media/cast:sender",
124       "//media/cast/logging/proto",
125     ]
126     if (!enable_webrtc) {
127       sources -= [
128         "media/cast_receiver_session.cc",
129         "media/cast_receiver_session.h",
130         "media/cast_rtp_stream.cc",
131         "media/cast_rtp_stream.h",
132       ]
133     }
134   }
135   if (enable_webrtc) {
136     sources +=
137         rebase_path(gypi_values.chrome_renderer_webrtc_sources, ".", "..")
138   }
139   if (enable_extensions && enable_webrtc) {
140     sources +=
141         rebase_path(gypi_values.chrome_renderer_webrtc_extensions_sources,
142                     ".",
143                     "..")
144   }
145   if (enable_spellcheck) {
146     sources +=
147         rebase_path(gypi_values.chrome_renderer_spellchecker_sources, ".", "..")
148     if (!is_android) {
149       deps += [ "//third_party/hunspell" ]
150     }
151   }
152   if (!use_browser_spellchecker) {
153     sources -= [
154       "spellchecker/platform_spelling_engine.cc",
155       "spellchecker/platform_spelling_engine.h",
156     ]
157   }
158   if (enable_basic_printing || enable_print_preview) {
159     deps += [ "//printing" ]
160     sources +=
161         rebase_path(gypi_values.chrome_renderer_printing_sources, ".", "..")
162     if (enable_print_preview) {
163       sources += rebase_path(gypi_values.chrome_renderer_full_printing_sources,
164                              ".",
165                              "..")
166     }
167   }
169   if (is_mac) {
170     deps += [ "//third_party/mach_override" ]
171   }
172   if (is_win) {
173     deps += [ "//third_party/wtl" ]
174   }
175   if (is_android) {
176     sources -= [
177       "spellchecker/hunspell_engine.cc",
178       "spellchecker/hunspell_engine.h",
179     ]
180   }
183 # In GYP this is part of test_support_common.
184 source_set("test_support") {
185   testonly = true
186   visibility = [ "//chrome/test:test_support" ]
188   sources = [
189     "chrome_mock_render_thread.cc",
190     "chrome_mock_render_thread.h",
191     "safe_browsing/mock_feature_extractor_clock.cc",
192     "safe_browsing/mock_feature_extractor_clock.h",
193     "safe_browsing/test_utils.cc",
194     "safe_browsing/test_utils.h",
195   ]
197   deps = [
198     ":renderer",
199     "//content/test:test_support",
200     "//testing/gmock",
201     "//testing/gtest",
202   ]
204   if (enable_print_preview) {
205     deps += [ "//chrome/service" ]
206   }
208   if (enable_webrtc) {
209     sources += [
210       "media/mock_webrtc_logging_message_filter.cc",
211       "media/mock_webrtc_logging_message_filter.h",
212     ]
213   }