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