NaCl cleanup: Use Bit('build_ARCH') instead of Bit('target_ARCH')
[chromium-blink-merge.git] / BUILD.gn
blob5c1e91e2e5b2520798439e01a72dea0206f206af
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   ]
141   deps += root_extra_deps
143   if (!is_win) {
144     deps += [ "//breakpad:symupload" ]
145   }
147   if (is_linux) {
148     deps += [
149       "//dbus",
150       "//third_party/fontconfig",
151       "//third_party/freetype2",
152     ]
153   }
155   if (use_x11) {
156     deps += [ "//tools/xdisplaycheck" ]
157   }
159   if (use_aura) {
160     deps += [ "//ui/wm" ]
161   }
163   if (is_win) {
164     deps += [ "//ui/metro_viewer" ]
165   }
167   if (is_win || is_mac || is_chromeos) {
168     # RLZ works on these platforms.
169     deps += [ "//rlz:rlz_lib" ]
170   }
172   if (cpu_arch == "x86" || cpu_arch == "x64") {
173     # YASM is x86/x64 only.
174     deps += [ "//third_party/yasm($host_toolchain)" ]
175   }
177   if (is_android) {
178     deps += [
179       "//base/android/linker:chromium_android_linker",
180       "//build/android/gyp/test:hello_world",
181       "//build/android/rezip",
182       "//third_party/openmax_dl/dl",
183       "//content/shell/android:content_shell_apk",
184       "//chrome/android:chrome_shell_apk",
185       "//chrome/test/chromedriver/test/webview_shell:chromedriver_webview_shell_apk",
186       "//ui/android:ui_java",
187       "//third_party/android_tools:android_gcm_java",
188       "//third_party/android_tools:uiautomator_java",
189       "//third_party/android_tools:android_support_v13_java",
190       "//third_party/android_tools:android_support_v7_appcompat_java",
191       "//third_party/android_tools:android_support_v7_mediarouter_java",
192     ]
194     if (has_chrome_android_internal) {
195       deps += [ "//clank" ]
196     }
198     # TODO(GYP): Move the targets in the rest of this block that still
199     # need to be made to work in the GN build to the bottom of the file
200     # so that all the remaining work is located in one place in the file.
201     # This block should contain only the targets that aren't actually
202     # needed on Android.
204     deps -= [
205       "//apps",  # Needs testing.
206       "//chrome/browser",
207       "//chrome/browser/devtools",
208       "//chrome/common",
209       "//chrome/plugin",
210       "//chrome/renderer",
211       "//chrome/test",
212       "//chrome/tools",
213       "//chrome/utility",
214       "//content/shell:content_shell",
215       "//extensions/browser",
216       "//extensions/common",
217       "//extensions/common/api",
218       "//extensions/renderer",
219       "//pdf",  # Not compiled on Android in GYP yet, either.
220       "//ppapi:ppapi_c",
221       "//third_party/libusb",
222       "//ui/keyboard",  # Blocked on content.
224       # Seems to not be compiled on Android. Otherwise it will need a config.h.
225       "//third_party/libxslt",
227       # Not relevant to Android.
228       "//ash",
229       "//tools/gn",
230       "//ui/aura",
231       "//ui/display",
232       "//ui/views",
233       "//ui/views/controls/webview",
235       # Fails on Android for unknown reasons.
236       "//third_party/flac",
237       "//breakpad:symupload",
239       # Not tested on Android yet:
240       "//google_apis/gcm",
241       "//remoting/client/plugin",
242       "//storage/browser",
243       "//third_party/cld_2",
244       "//third_party/ffmpeg",
245       "//ui/app_list",
246       "//ui/web_dialogs",
247     ]
248   }
250   if (use_ozone) {
251     deps += [
252       "//ui/ozone",
253       "//ui/ozone/demo",
254     ]
255   }
257   # Non-mobile builds.
258   if (!is_android && !is_ios) {
259     deps += [
260       "//device/usb",
261       "//third_party/pdfium/samples",
262     ]
263   }
265   #
266   # TODO(GYP): Make everything below this work in the GN build.
267   #
269   if (is_mac) {
270     # TODO(dpranke): These are as-yet untriaged but need at least the above.
271     deps -= [
272       "//apps",
273       "//ash",
274       "//chrome/browser",
275       "//chrome/browser/devtools",
276       "//chrome/common",
277       "//chrome/plugin",
278       "//chrome/renderer",
279       "//chrome/test",
280       "//chrome/utility",
281       "//components:all_components",
282       "//content/shell:content_shell",
283       "//extensions/browser",
284       "//extensions/common",
285       "//extensions/common/api",
286       "//extensions/renderer",
287       "//remoting/client/plugin",
288       "//third_party/usrsctp",
289       "//ui/app_list",
290       "//ui/aura",
291       "//ui/keyboard",
292       "//ui/views",
293       "//ui/views/controls/webview",
294       "//ui/web_dialogs",
295     ]
296   }
298   if (is_win) {
299     deps -= [
300       "//apps",
301       "//ash",
302       "//chrome/browser",
303       "//chrome/browser/devtools",
304       "//chrome/common",
305       "//chrome/plugin",
306       "//chrome/renderer",
307       "//chrome/test",
308       "//chrome/utility",
309       "//components:all_components",
310       "//cc",
311       "//cc/blink",
312       "//content",
313       "//content/shell:content_shell",
314       "//content/test:test_support",
315       "//device/bluetooth",
316       "//extensions/browser",
317       "//extensions/common",
318       "//extensions/common/api",
319       "//extensions/renderer",
320       "//gpu",
321       "//google_apis",
322       "//google_apis/gcm",
323       "//jingle:notifier",
324       "//media",
325       "//media/blink",
326       "//media/cast",
327       "//media/mojo",
328       "//mojo",
329       "//pdf",
330       "//ppapi:ppapi_c",
331       "//printing",
332       "//remoting/client/plugin",
333       "//sandbox",
334       "//storage/browser",
335       "//sync",
336       "//third_party/WebKit/public:all_blink",
337       "//third_party/angle:translator",
338       "//third_party/ffmpeg",
339       "//third_party/leveldatabase",
340       "//third_party/libjingle",
341       "//third_party/usrsctp",
342       "//third_party/webrtc",
343       "//ui/accessibility",
344       "//ui/app_list",
345       "//ui/aura",
346       "//ui/base",
347       "//ui/display",
348       "//ui/events",
349       "//ui/gfx",
350       "//ui/gl",
351       "//ui/keyboard",
352       "//ui/native_theme",
353       "//ui/snapshot",
354       "//ui/surface",
355       "//ui/views",
356       "//ui/views/controls/webview",
357       "//ui/web_dialogs",
358       "//ui/wm",
359     ]
360   }