Fix bug that AddBookmarks returns partner bookmark node
[chromium-blink-merge.git] / BUILD.gn
blob124e0ff9244f670d35fe8c084e8f88057cad336c
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/features.gni")
12 import("//build/config/ui.gni")
13 if (is_android) {
14   import("//build/config/android/config.gni")
17 declare_args() {
18   # A list of extra dependencies to add to the root target. This allows a
19   # checkout to add additional targets without explicitly changing any checked-
20   # in files.
21   root_extra_deps = []
24 # In GN, a "group" is a dummy target that just lists other targets.
25 group("root") {
26   # This should not be linked into production and depends on test targets.
27   testonly = true
29   # Note that some dependencies are commented out. These are things that are
30   # currently written but not hooked up to the build yet. They may need to be
31   # completed or possibly just tested and then re-enabled.
32   deps = [
33     "//apps",
34     "//ash",
35     "//cc",
36     "//cc/blink",
37     "//chrome/browser",
38     "//chrome/browser/devtools",
39     "//chrome/common",
40     "//chrome/plugin",
41     "//chrome/renderer",
42     "//chrome/test",
43     "//chrome/tools",
44     "//chrome/utility",
45     "//components:all_components",
46     "//content",
47     "//content/shell:content_shell",
48     "//content/test:test_support",
49     "//crypto",
50     "//device/battery",
51     "//device/bluetooth",
52     "//device/nfc",
53     "//device/vibration",
54     "//extensions/browser",
55     "//extensions/common",
56     "//extensions/common/api",
57     "//extensions/renderer",
58     "//gin",
59     "//gpu",
60     "//google_apis",
61     "//google_apis/gcm",
62     "//ipc",
63     "//ipc/mojo",
64     "//jingle:notifier",
65     "//media",
66     "//media/blink",
67     "//media/cast",
68     "//media/mojo",
69     "//mojo",
70     "//net",
71     "//pdf",
72     "//ppapi/examples",
73     "//printing",
74     "//remoting/client/plugin",
75     "//sandbox",
76     "//sdch",
77     "//skia",
78     "//storage/browser",
79     "//sql",
80     "//sync",
81     "//third_party/WebKit/public:all_blink",
82     "//third_party/angle:translator",
83     "//third_party/brotli",
84     "//third_party/cacheinvalidation",
85     "//third_party/cld",
86     "//third_party/cld_2",
87     "//third_party/codesighs",
88     "//third_party/ffmpeg",
89     "//third_party/flac",
90     "//third_party/harfbuzz-ng",
91     "//third_party/hunspell",
92     "//third_party/iccjpeg",
93     "//third_party/icu",
94     "//third_party/leveldatabase",
95     "//third_party/libphonenumber",
96     "//third_party/libjingle",
97     "//third_party/libpng",
98     "//third_party/libsrtp",
99     "//third_party/libusb",
100     "//third_party/libwebp",
101     "//third_party/libxslt",
102     "//third_party/libvpx",
103     "//third_party/libyuv",
104     "//third_party/lzma_sdk",
105     "//third_party/mesa",
106     "//third_party/opus",
107     "//third_party/ots",
108     "//third_party/protobuf:protobuf_lite",
109     "//third_party/qcms",
110     "//third_party/re2",
111     "//third_party/smhasher:cityhash",
112     "//third_party/smhasher:murmurhash3",
113     "//third_party/smhasher:pmurhash",
114     "//third_party/snappy",
115     "//third_party/speex",
116     "//third_party/usrsctp",
117     "//third_party/widevine/cdm:version_h",
118     "//third_party/webrtc",
119     "//third_party/zlib",
120     "//third_party:jpeg",
121     "//tools/gn",
122     "//tools/imagediff($host_toolchain)",
123     "//tools/telemetry:bitmaptools",
124     "//ui/accessibility",
125     "//ui/app_list",
126     "//ui/aura",
127     "//ui/base",
128     "//ui/display",
129     "//ui/events",
130     "//ui/gfx",
131     "//ui/gl",
132     "//ui/keyboard",
133     "//ui/native_theme",
134     "//ui/resources",
135     "//ui/snapshot",
136     "//ui/strings",
137     "//ui/surface",
138     "//ui/touch_selection",
139     "//ui/views",
140     "//ui/views/controls/webview",
141     "//ui/web_dialogs",
142     "//url",
143     "//v8:v8",
144   ]
145   deps += root_extra_deps
147   # TODO(GYP): Get this working on the mac?
148   if (enable_extensions && !is_mac) {
149     deps += [ "//extensions/shell:app_shell_unittests" ]
150   }
152   if (!is_win) {
153     deps += [ "//breakpad:symupload" ]
154   }
156   if (is_linux) {
157     deps += [
158       "//dbus",
159       "//third_party/fontconfig",
160       "//third_party/freetype2",
161     ]
162   }
164   if (use_x11) {
165     deps += [ "//tools/xdisplaycheck" ]
166   }
168   if (use_aura) {
169     deps += [ "//ui/wm" ]
170   }
172   if (is_win) {
173     deps += [ "//ui/metro_viewer" ]
174   }
176   if (is_win || is_mac || is_chromeos) {
177     # RLZ works on these platforms.
178     deps += [ "//rlz:rlz_lib" ]
179   }
181   if (current_cpu == "x86" || current_cpu == "x64") {
182     # YASM is x86/x64 only.
183     deps += [ "//third_party/yasm($host_toolchain)" ]
184   }
186   if (is_android) {
187     deps += [
188       "//base/android/linker:chromium_android_linker",
189       "//build/android/gyp/test:hello_world",
190       "//build/android/rezip",
191       "//third_party/openmax_dl/dl",
192       "//content/shell/android:content_shell_apk",
193       "//chrome/android:chrome_shell_apk",
194       "//chrome/test:test_support_unit",
195       "//chrome/test/chromedriver/test/webview_shell:chromedriver_webview_shell_apk",
196       "//ui/android:ui_java",
197       "//third_party/android_tools:android_gcm_java",
198       "//third_party/android_tools:uiautomator_java",
199       "//third_party/android_tools:android_support_v13_java",
200       "//third_party/android_tools:android_support_v7_appcompat_java",
201       "//third_party/android_tools:android_support_v7_mediarouter_java",
202       "//third_party/mockito:mockito_java",
203     ]
205     if (has_chrome_android_internal) {
206       deps += [ "//clank" ]
207     }
209     # TODO(GYP): Move the targets in the rest of this block that still
210     # need to be made to work in the GN build to the bottom of the file
211     # so that all the remaining work is located in one place in the file.
212     # This block should contain only the targets that aren't actually
213     # needed on Android.
215     deps -= [
216       "//apps",  # Needs testing.
217       "//chrome/browser",
218       "//chrome/browser/devtools",
219       "//chrome/common",
220       "//chrome/plugin",
221       "//chrome/renderer",
222       "//chrome/test",
223       "//chrome/tools",
224       "//chrome/utility",
225       "//content/shell:content_shell",
226       "//extensions/browser",
227       "//extensions/common",
228       "//extensions/common/api",
229       "//extensions/renderer",
230       "//pdf",  # Not compiled on Android in GYP yet, either.
231       "//ppapi/examples",
232       "//third_party/libusb",
233       "//ui/keyboard",  # Blocked on content.
235       # Seems to not be compiled on Android. Otherwise it will need a config.h.
236       "//third_party/libxslt",
238       # Not relevant to Android.
239       "//ash",
240       "//tools/gn",
241       "//ui/aura",
242       "//ui/display",
243       "//ui/views",
244       "//ui/views/controls/webview",
246       # Fails on Android for unknown reasons.
247       "//third_party/flac",
248       "//breakpad:symupload",
250       # Not tested on Android yet:
251       "//google_apis/gcm",
252       "//remoting/client/plugin",
253       "//storage/browser",
254       "//third_party/cld_2",
255       "//third_party/ffmpeg",
256       "//ui/app_list",
257       "//ui/web_dialogs",
258     ]
259   }
261   if (use_ozone) {
262     deps += [
263       "//ui/ozone",
264       "//ui/ozone/demo",
265     ]
266   }
268   # Non-mobile builds.
269   if (!is_android && !is_ios) {
270     deps += [
271       "//device/usb",
272       "//device:device_unittests",
273       "//third_party/pdfium/samples",
274     ]
275   }
277   #
278   # TODO(GYP): Make everything below this work in the GN build.
279   #
281   if (is_mac) {
282     deps += [
283       "//third_party/apple_sample_code",
284       "//third_party/molokocacao",
285     ]
287     # TODO(dpranke): These are as-yet untriaged but need at least the above.
288     deps -= [
289       "//apps",
290       "//ash",
291       "//chrome/browser",
292       "//chrome/browser/devtools",
293       "//chrome/common",
294       "//chrome/plugin",
295       "//chrome/renderer",
296       "//chrome/test",
297       "//chrome/utility",
298       "//components:all_components",
299       "//content/shell:content_shell",
300       "//extensions/browser",
301       "//extensions/common",
302       "//extensions/common/api",
303       "//extensions/renderer",
304       "//remoting/client/plugin",
305       "//third_party/usrsctp",
306       "//ui/app_list",
307       "//ui/aura",
308       "//ui/keyboard",
309       "//ui/views",
310       "//ui/views/controls/webview",
311       "//ui/web_dialogs",
312     ]
313   }
315   if (is_mac || is_ios) {
316     deps -= [ "//ui/touch_selection" ]
317   }