Upstream version 5.34.92.0
[platform/framework/web/crosswalk.git] / src / tools / gn / secondary / chrome / BUILD.gn
1 # Copyright (c) 2013 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.
4
5 import("//crypto/ssl/flags.gni")
6 import("//tools/grit/grit_rule.gni")
7
8 executable("chrome") {
9   sources = [
10     "app/breakpad_field_trial_win.cc",
11     "app/breakpad_field_trial_win.h",
12     "app/breakpad_win.cc",
13     "app/breakpad_win.h",
14     "app/chrome_dll_resource.h",
15     "app/chrome_exe_main_aura.cc",
16     "app/chrome_exe_main_gtk.cc",
17     "app/chrome_exe_main_mac.cc",
18     "app/chrome_exe_main_win.cc",
19     "app/chrome_exe_resource.h",
20     "app/chrome_main.cc",
21     "app/chrome_main_delegate.cc",
22     "app/chrome_main_delegate.h",
23     "app/client_util.cc",
24     "app/client_util.h",
25     "app/hard_error_handler_win.cc",
26     "app/hard_error_handler_win.h",
27     "app/metro_driver_win.cc",
28     "app/metro_driver_win.h",
29     "../content/app/startup_helper_win.cc",
30   ]
31
32   if (is_linux) {
33     configs += [
34       # TODO(brettw) this is wrong, it should be picked up from deps.
35       "//build/config/linux:gtk",
36       "//build/config/linux:x11",
37     ]
38   }
39
40   deps = [
41     # TODO(brettw) this is right on linux? Everything is linked into the
42     # exe, but wrong on Windows, where chrome_exe and chrome_dll are separate.
43     ":browser",
44     ":common",
45     ":debugger",
46     ":plugin",
47     ":renderer",
48     ":utility",
49     "//base",
50   ]
51
52   # TODO(brettw) this isn't right for all platforms.
53   if (!use_aura) {
54     sources -= [ "app/chrome_exe_main_aura.cc" ]
55   }
56
57   if (!is_win) {
58     sources -= [
59       "app/client_util.cc",
60       "app/client_util.h",
61     ]
62   }
63 }
64
65 static_library("browser") {
66   external = true
67
68   if (is_linux) {
69     libs = [ "dl" ]
70     if (toolkit_uses_gtk) {
71       libs += [ "gconf-2" ]
72     }
73   }
74   if (is_linux) {
75     configs += [
76       "//build/config/linux:x11",
77     ]
78   }
79
80   deps = [
81     "//third_party/expat",
82   ]
83 }
84
85 static_library("common") {
86   external = true
87
88   if (use_nss && is_linux) {
89     # common/net uses NSS.
90     # TODO(brettw) have a better way to express this without having to do
91     # "if (use_nss)" everywhere.
92     configs += [ "//third_party/nss:nss_linux_config" ]
93   }
94   deps = [
95   ]
96 }
97
98 # TODO(brettw) move to browser/devtools/BUILD.gn
99 source_set("debugger") {
100   sources = [
101     "browser/devtools/adb/android_rsa.cc",
102     "browser/devtools/adb/android_rsa.h",
103     "browser/devtools/adb/android_usb_device.cc",
104     "browser/devtools/adb/android_usb_device.h",
105     "browser/devtools/adb/android_usb_socket.cc",
106     "browser/devtools/adb/android_usb_socket.h",
107     "browser/devtools/adb_client_socket.cc",
108     "browser/devtools/adb_client_socket.h",
109     "browser/devtools/adb_web_socket.cc",
110     "browser/devtools/adb_web_socket.h",
111     "browser/devtools/browser_list_tabcontents_provider.cc",
112     "browser/devtools/browser_list_tabcontents_provider.h",
113     "browser/devtools/devtools_adb_bridge.cc",
114     "browser/devtools/devtools_adb_bridge.h",
115     "browser/devtools/devtools_embedder_message_dispatcher.cc",
116     "browser/devtools/devtools_embedder_message_dispatcher.h",
117     "browser/devtools/devtools_file_helper.cc",
118     "browser/devtools/devtools_file_helper.h",
119     "browser/devtools/devtools_file_system_indexer.cc",
120     "browser/devtools/devtools_file_system_indexer.h",
121     "browser/devtools/devtools_protocol.cc",
122     "browser/devtools/devtools_protocol.h",
123     "browser/devtools/devtools_toggle_action.h",
124     "browser/devtools/devtools_window.cc",
125     "browser/devtools/devtools_window.h",
126     "browser/devtools/port_forwarding_controller.cc",
127     "browser/devtools/port_forwarding_controller.h",
128     "browser/devtools/remote_debugging_server.cc",
129     "browser/devtools/remote_debugging_server.h",
130   ]
131
132   deps = [
133 #    ":chrome_extra_resources",
134 #    ":chrome_resources",
135 #    ":chrome_strings",
136 #    ":theme_resources",
137     "//base",
138     "//net",
139     "//net:http_server",
140     "//skia",
141     "//third_party/icu:icui18n",
142     "//third_party/icu:icuuc",
143     "//third_party/leveldatabase",
144     "//third_party/libusb",
145   ]
146
147   if (is_android) {
148     sources -= [
149       "browser/devtools/adb/android_rsa.cc",
150       "browser/devtools/browser_list_tabcontents_provider.cc",
151       "browser/devtools/devtools_file_system_indexer.cc",
152       "browser/devtools/devtools_window.cc",
153       "browser/devtools/remote_debugging_server.cc",
154     ]
155     deps -= "//third_party/libusb"
156   }
157
158   # TODO implement debug_devtools
159   # if (debug_devtools) {
160   #   defines = [ "DEBUG_DEVTOOLS=1" ]
161   # }
162   # TODO(brettw) this may be required on Windows:
163   # if (is_win) {
164   #   TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
165   #   'msvs_disabled_warnings': [ 4267, ]
166   # }
167
168 }
169
170 source_set("plugin") {
171   external = true
172 }
173
174 source_set("renderer") {
175   external = true
176 }
177
178 source_set("utility") {
179   external = true
180 }
181
182
183 # Credits ----------------------------------------------------------------------
184
185 about_credits_file = "$root_gen_dir/about_credits.html"
186 build_relative_about_credits_file =
187   rebase_path(about_credits_file, ".", root_build_dir)
188
189 custom("about_credits") {
190   script = "//tools/licenses.py"
191   outputs = [ about_credits_file ]
192
193   # This script is impossible to write proper input dependencies for because it
194   # basically greps the source tree for third_party directories. If a directory
195   # is added or removed, it will change the result, but there is no way to
196   # express this as a build dependency. We approximate this by depending on
197   # the last change file to force an update whenever the code is updated.
198   source_prereqs = [ "//build/util/LASTCHANGE" ]
199
200   hard_dep = true
201
202   args = [ "credits", build_relative_about_credits_file ]
203 }
204
205 # Resources --------------------------------------------------------------------
206
207 #group("chrome_resources") {
208 #  deps = [
209 #    ":browser_resources",
210 #    ":common_resources",
211 #    ":renderer_resources",
212 #  ]
213 #}
214 #grit("browser_resources") {
215 #  source = "browser/browser_resources.grd"
216 #  grit_flags = [ "-E", "about_credits_file=$build_relative_about_credits_file" ]
217 #  deps = [ ":about_credits" ]
218 #}
219 #grit("common_resources") {
220 #  source = "common/common_resources.grd"
221 #}
222 #grit("renderer_resources") {
223 #  source = "renderer/resources/renderer_resources.grd"
224 #}
225 #
226 #group("chrome_strings") {
227 #  deps = [
228 #    ":locale_settings",
229 #    ":chromium_strings",
230 #    ":generated_resources",
231 #    ":google_chrome_strings",
232 #  ]
233 #}
234 #grit("locale_settings") {
235 #  source = "app/resources/locale_settings.grd"
236 #}
237 #grit("chromium_strings") {
238 #  source = "app/chromium_strings.grd"
239 #}
240 #grit("generated_resources") {
241 #  source = "app/generated_resources.grd"
242 #}
243 #grit("google_chrome_strings") {
244 #  source = "app/google_chrome_strings.grd"
245 #}
246 #
247 #group("chrome_extra_resources") {
248 #  deps = [
249 #    ":memory_internals_resources",
250 #    ":net_internals_resources",
251 #    ":signin_internals_resources",
252 #    ":sync_internals_resources",
253 #    ":translate_internals_resources",
254 #  ]
255 #
256 #  if (!is_ios) {
257 #    deps += [
258 #      ":component_extension_resources",
259 #      ":devtools_discovery_page_resources",
260 #      ":options_resources",
261 #      ":quota_internals_resources",
262 #      ":sync_file_system_internals_resources",
263 #    ]
264 #  }
265 #}
266 #grit("component_extension_resources") {
267 #  source = "browser/resources/component_extension_resources.grd"
268 #}
269 #grit("devtools_discovery_page_resources") {
270 #  source = "browser/devtools/frontend/devtools_discovery_page_resources.grd"
271 #}
272 #grit("memory_internals_resources") {
273 #  source = "browser/resources/memory_internals_resources.grd"
274 #}
275 #grit("quota_internals_resources") {
276 #  source = "browser/resources/quota_internals_resources.grd"
277 #}
278 #grit("net_internals_resources") {
279 #  source = "browser/resources/net_internals_resources.grd"
280 #}
281 #grit("options_resources") {
282 #  source = "browser/resources/options_resources.grd"
283 #}
284 #grit("signin_internals_resources") {
285 #  source = "browser/resources/signin_internals_resources.grd"
286 #}
287 #grit("sync_file_system_internals_resources") {
288 #  source = "browser/resources/sync_file_system_internals_resources.grd"
289 #}
290 #grit("sync_internals_resources") {
291 #  source = "browser/resources/sync_internals_resources.grd"
292 #}
293 #grit("translate_internals_resources") {
294 #  source = "browser/resources/translate_internals_resources.grd"
295 #}
296 #
297 #group("theme_resources") {
298 #  deps = [
299 #    ":theme_resources_gen",
300 #    #"//ui:ui_resources",
301 #  ]
302 #}
303 #
304 ## TODO(brettw) rename "app_theme_resources" or something when we don't support
305 ## GYP any more. This name is required to match the GYP build.
306 #grit("theme_resources_gen") {
307 #  source = "app/theme/theme_resources.grd"
308 #}