Fix build.
[chromium-blink-merge.git] / BUILD.gn
blob5206979d1d6b7a36bc1eae114606cb33354c18df
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.
5 # This is the root build file for GN. GN will start processing by loading this
6 # file, and recursively load all dependencies until all dependencies are either
7 # resolved or known not to exist (which will cause the build to fail). So if
8 # you add a new build file, there must be some path of dependencies from this
9 # file to your new one or GN won't know about it.
11 import("//build/config/ui.gni")
12 if (is_android) {
13   import("//build/config/android/config.gni")
16 declare_args() {
17   # A list of extra dependencies to add to the root target. This allows a
18   # checkout to add additional targets without explicitly changing any checked-
19   # in files.
20   root_extra_deps = []
23 # In GN, a "group" is a dummy target that just lists other targets.
24 group("root") {
25   # This should not be linked into production and depends on test targets.
26   testonly = true
28   # Note that some dependencies are commented out. These are things that are
29   # currently written but not hooked up to the build yet. They may need to be
30   # completed or possibly just tested and then re-enabled.
31   deps = [
32     "//apps",
33     "//ash",
34     "//cc",
35     "//cc/blink",
36     "//chrome/browser",
37     "//chrome/browser/devtools",
38     "//chrome/common",
39     "//chrome/plugin",
40     "//chrome/renderer",
41     "//chrome/test",
42     "//chrome/tools",
43     "//chrome/utility",
44     "//components:all_components",
45     "//content",
46     "//content/shell:content_shell",
47     "//content/test:test_support",
48     "//crypto",
49     "//device/battery",
50     "//device/bluetooth",
51     "//device/nfc",
52     "//extensions/browser",
53     "//extensions/common",
54     "//extensions/common/api",
55     "//extensions/renderer",
56     "//gin",
57     "//gpu",
58     "//google_apis",
59     "//google_apis/gcm",
60     "//ipc",
61     "//ipc/mojo",
62     "//jingle:notifier",
63     "//media",
64     "//media/blink",
65     "//media/cast",
66     "//media/mojo",
67     "//mojo",
68     "//net",
69     "//pdf",
70     "//ppapi:ppapi_c",
71     "//printing",
72     "//remoting/client/plugin",
73     "//sandbox",
74     "//sdch",
75     "//skia",
76     "//storage/browser",
77     "//sql",
78     "//sync",
79     "//third_party/WebKit/public:all_blink",
80     "//third_party/angle:translator",
81     "//third_party/brotli",
82     "//third_party/cacheinvalidation",
83     "//third_party/cld",
84     "//third_party/cld_2",
85     "//third_party/ffmpeg",
86     "//third_party/flac",
87     "//third_party/harfbuzz-ng",
88     "//third_party/hunspell",
89     "//third_party/iccjpeg",
90     "//third_party/icu",
91     "//third_party/leveldatabase",
92     "//third_party/libphonenumber",
93     "//third_party/libjingle",
94     "//third_party/libpng",
95     "//third_party/libsrtp",
96     "//third_party/libusb",
97     "//third_party/libwebm",
98     "//third_party/libwebp",
99     "//third_party/libxslt",
100     "//third_party/libvpx",
101     "//third_party/libyuv",
102     "//third_party/lzma_sdk",
103     "//third_party/mesa",
104     "//third_party/opus",
105     "//third_party/ots",
106     "//third_party/protobuf:protobuf_lite",
107     "//third_party/qcms",
108     "//third_party/re2",
109     "//third_party/smhasher:cityhash",
110     "//third_party/smhasher:murmurhash3",
111     "//third_party/smhasher:pmurhash",
112     "//third_party/snappy",
113     "//third_party/speex",
114     "//third_party/usrsctp",
115     "//third_party/widevine/cdm:version_h",
116     "//third_party/webrtc",
117     "//third_party/zlib",
118     "//third_party:jpeg",
119     "//tools/gn",
120     "//tools/imagediff($host_toolchain)",
121     "//ui/accessibility",
122     "//ui/app_list",
123     "//ui/aura",
124     "//ui/base",
125     "//ui/display",
126     "//ui/events",
127     "//ui/gfx",
128     "//ui/gl",
129     "//ui/keyboard",
130     "//ui/native_theme",
131     "//ui/resources",
132     "//ui/snapshot",
133     "//ui/strings",
134     "//ui/surface",
135     "//ui/views",
136     "//ui/views/controls/webview",
137     "//ui/web_dialogs",
138     "//url",
139     "//v8:v8",
140   ] + root_extra_deps
142   if (!is_win) {
143     deps += [ "//breakpad:symupload" ]
144   }
146   if (is_linux) {
147     deps += [
148       "//dbus",
149       "//third_party/fontconfig",
150       "//third_party/freetype2",
151     ]
152   }
154   if (use_x11) {
155     deps += [ "//tools/xdisplaycheck" ]
156   }
158   if (use_aura) {
159     deps += [ "//ui/wm" ]
160   }
162   if (is_win) {
163     deps += [
164       "//ui/metro_viewer",
165     ]
166   }
168   if (is_win || is_mac || is_chromeos) {
169     # RLZ works on these platforms.
170     deps += [
171       "//rlz:rlz_lib",
172     ]
173   }
175   if (cpu_arch == "x86" || cpu_arch == "x64") {
176     # YASM is x86/x64 only.
177     deps += [ "//third_party/yasm($host_toolchain)" ]
178   }
180   if (is_android) {
181     deps += [
182       "//base/android/linker:chromium_android_linker",
183       "//build/android/gyp/test:hello_world",
184       "//build/android/rezip",
185       "//third_party/openmax_dl/dl",
186       "//content/shell/android:content_shell_apk",
187       "//chrome/android:chrome_shell_apk",
188       "//chrome/test/chromedriver/test/webview_shell:chromedriver_webview_shell_apk",
189       "//ui/android:ui_java",
190       "//third_party/android_tools:android_gcm_java",
191       "//third_party/android_tools:uiautomator_java",
192       "//third_party/android_tools:android_support_v13_java",
193       "//third_party/android_tools:android_support_v7_appcompat_java",
194       "//third_party/android_tools:android_support_v7_mediarouter_java",
195       "//third_party/eyesfree:eyesfree_java",
196     ]
198     if (has_chrome_android_internal) {
199       deps += [
200         "//clank",
201       ]
202     }
204     # TODO(GYP): Move the targets in the rest of this block that still
205     # need to be made to work in the GN build to the bottom of the file
206     # so that all the remaining work is located in one place in the file.
207     # This block should contain only the targets that aren't actually
208     # needed on Android.
210     deps -= [
211       "//apps",  # Needs testing.
212       "//chrome/browser",
213       "//chrome/browser/devtools",
214       "//chrome/common",
215       "//chrome/plugin",
216       "//chrome/renderer",
217       "//chrome/test",
218       "//chrome/tools",
219       "//chrome/utility",
220       "//content/shell:content_shell",
221       "//extensions/browser",
222       "//extensions/common",
223       "//extensions/common/api",
224       "//extensions/renderer",
225       "//pdf",  # Not compiled on Android in GYP yet, either.
226       "//ppapi:ppapi_c",
227       "//third_party/libusb",
228       "//ui/keyboard",  # Blocked on content.
230       # Seems to not be compiled on Android. Otherwise it will need a config.h.
231       "//third_party/libxslt",
233       # Not relevant to Android.
234       "//ash",
235       "//tools/gn",
236       "//ui/aura",
237       "//ui/display",
238       "//ui/views",
239       "//ui/views/controls/webview",
241       # Fails on Android for unknown reasons.
242       "//third_party/flac",
243       "//breakpad:symupload",
245       # Not tested on Android yet:
246       "//google_apis/gcm",
247       "//remoting/client/plugin",
248       "//storage/browser",
249       "//third_party/cld_2",
250       "//third_party/ffmpeg",
251       "//ui/app_list",
252       "//ui/web_dialogs",
253     ]
254   }
256   if (use_ozone) {
257     deps += [
258       "//ui/ozone",
259       "//ui/ozone/demo",
260     ]
261   }
263   # Non-mobile builds.
264   if (!is_android && !is_ios) {
265     deps += [
266       "//device/usb",
267       "//third_party/pdfium/samples",
268     ]
269   }
271   # 
272   # TODO(GYP): Make everything below this work in the GN build.
273   #
275   if (is_mac) {
276     # TODO(dpranke): Need to fix the unused function errors in breakpad.
277     deps -= [
278       "//breakpad:symupload"
279     ]
281     # TODO(dpranke): These need a webrtc fix in order to build.
282     deps -= [
283       "//jingle:notifier",
284       "//third_party/libjingle",
285       "//third_party/webrtc",
286     ]
288     # TODO(dpranke): These depend on Blink and need Blink fixes to build.
289     deps -= [
290       "//cc/blink",
291       "//content",
292       "//content/test:test_support",
293       "//media/blink",
294       "//pdf",
295       "//ppapi:ppapi_c",
296       "//third_party/WebKit/public:all_blink",
297       "//ui/app_list",
298     ]
300     # TODO(dpranke): These are as-yet untriaged but need at least the above.
301     deps -= [
302       "//apps",
303       "//ash",
304       "//chrome/browser",
305       "//chrome/browser/devtools",
306       "//chrome/common",
307       "//chrome/plugin",
308       "//chrome/renderer",
309       "//chrome/test",
310       "//chrome/utility",
311       "//components:all_components",
312       "//content/shell:content_shell",
313       "//extensions/browser",
314       "//extensions/common",
315       "//extensions/common/api",
316       "//extensions/renderer",
317       "//remoting/client/plugin",
318       "//third_party/usrsctp",
319       "//ui/aura",
320       "//ui/keyboard",
321       "//ui/views",
322       "//ui/views/controls/webview",
323       "//ui/web_dialogs",
324     ]
325   }
327   if (is_win) {
328     deps -= [
329       "//apps",
330       "//ash",
331       "//chrome/browser",
332       "//chrome/browser/devtools",
333       "//chrome/common",
334       "//chrome/plugin",
335       "//chrome/renderer",
336       "//chrome/test",
337       "//chrome/utility",
338       "//components:all_components",
339       "//cc",
340       "//cc/blink",
341       "//content",
342       "//content/shell:content_shell",
343       "//content/test:test_support",
344       "//device/bluetooth",
345       "//extensions/browser",
346       "//extensions/common",
347       "//extensions/common/api",
348       "//extensions/renderer",
349       "//gpu",
350       "//google_apis",
351       "//google_apis/gcm",
352       "//jingle:notifier",
353       "//media",
354       "//media/blink",
355       "//media/cast",
356       "//media/mojo",
357       "//mojo",
358       "//pdf",
359       "//ppapi:ppapi_c",
360       "//printing",
361       "//remoting/client/plugin",
362       "//sandbox",
363       "//storage/browser",
364       "//sync",
365       "//third_party/WebKit/public:all_blink",
366       "//third_party/angle:translator",
367       "//third_party/ffmpeg",
368       "//third_party/leveldatabase",
369       "//third_party/libjingle",
370       "//third_party/usrsctp",
371       "//third_party/webrtc",
372       "//ui/accessibility",
373       "//ui/app_list",
374       "//ui/aura",
375       "//ui/base",
376       "//ui/display",
377       "//ui/events",
378       "//ui/gfx",
379       "//ui/gl",
380       "//ui/keyboard",
381       "//ui/native_theme",
382       "//ui/snapshot",
383       "//ui/surface",
384       "//ui/views",
385       "//ui/views/controls/webview",
386       "//ui/web_dialogs",
387       "//ui/wm",
388     ]
389   }