Remove kIgnoreResolutionLimitsForAcceleratedVideoDecode flag
[chromium-blink-merge.git] / build / config / BUILD.gn
blob44c87eb701b5e4121c9d1a6c5e85f90c67ba5a46
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 import("//build/config/allocator.gni")
6 import("//build/config/chrome_build.gni")
7 import("//build/config/crypto.gni")
8 import("//build/config/features.gni")
9 import("//build/config/ui.gni")
10 import("//build/module_args/v8.gni")
12 declare_args() {
13   # When set, turns off the (normally-on) iterator debugging and related stuff
14   # that is normally turned on for Debug builds. These are generally useful for
15   # catching bugs but in some cases may cause conflicts or excessive slowness.
16   disable_iterator_debugging = false
18   # Set to true to not store any build metadata, e.g. ifdef out all __DATE__
19   # and __TIME__. Set to 0 to reenable the use of these macros in the code
20   # base. See http://crbug.com/314403.
21   #
22   # Continue to embed build meta data in Official builds, basically the
23   # time it was built.
24   # TODO(maruel): This decision should be revisited because having an
25   # official deterministic build has high value too but MSVC toolset can't
26   # generate anything deterministic with WPO enabled AFAIK.
27   dont_embed_build_metadata = !is_official_build
29   # Set to true to enable dcheck in Release builds.
30   dcheck_always_on = false
32   # Set to true to compile with the OpenGL ES 2.0 conformance tests.
33   internal_gles2_conform_tests = false
36 # TODO(brettw) Most of these should be removed. Instead of global feature
37 # flags, we should have more modular flags that apply only to a target and its
38 # dependents. For example, depending on the "x11" meta-target should define
39 # USE_X11 for all dependents so that everything that could use X11 gets the
40 # define, but anything that doesn't depend on X11 doesn't see it.
42 # For now we define these globally to match the current GYP build.
43 config("feature_flags") {
44   # TODO(brettw) this probably needs to be parameterized.
45   defines = [ "V8_DEPRECATION_WARNINGS" ]  # Don't use deprecated V8 APIs anywhere.
47   if (cld_version > 0) {
48     defines += [ "CLD_VERSION=$cld_version" ]
49   }
50   if (enable_mdns) {
51     defines += [ "ENABLE_MDNS=1" ]
52   }
53   if (enable_notifications) {
54     defines += [ "ENABLE_NOTIFICATIONS" ]
55   }
56   if (enable_pepper_cdms) {
57     # TODO(brettw) should probably be "=1"
58     defines += [ "ENABLE_PEPPER_CDMS" ]
59   }
60   if (enable_browser_cdms) {
61     # TODO(brettw) should probably be "=1"
62     defines += [ "ENABLE_BROWSER_CDMS" ]
63   }
64   if (enable_plugins) {
65     defines += [ "ENABLE_PLUGINS=1" ]
66   }
67   if (enable_basic_printing || enable_print_preview) {
68     # Convenience define for ENABLE_BASIC_PRINTING || ENABLE_PRINT_PREVIEW.
69     defines += [ "ENABLE_PRINTING=1" ]
70     if (enable_basic_printing) {
71       # Enable basic printing support and UI.
72       defines += [ "ENABLE_BASIC_PRINTING=1" ]
73     }
74     if (enable_print_preview) {
75       # Enable printing with print preview.
76       # Can be defined without ENABLE_BASIC_PRINTING.
77       defines += [ "ENABLE_PRINT_PREVIEW=1" ]
78     }
79   }
80   if (enable_spellcheck) {
81     defines += [ "ENABLE_SPELLCHECK=1" ]
82   }
83   if (dont_embed_build_metadata) {
84     defines += [ "DONT_EMBED_BUILD_METADATA" ]
85   }
86   if (dcheck_always_on) {
87     defines += [ "DCHECK_ALWAYS_ON=1" ]
88   }
89   if (use_udev) {
90     # TODO(brettw) should probably be "=1".
91     defines += [ "USE_UDEV" ]
92   }
93   if (toolkit_views) {
94     defines += [ "TOOLKIT_VIEWS=1" ]
95   }
96   if (ui_compositor_image_transport) {
97     # TODO(brettw) should probably be "=1".
98     defines += [ "UI_COMPOSITOR_IMAGE_TRANSPORT" ]
99   }
100   if (use_ash) {
101     defines += [ "USE_ASH=1" ]
102   }
103   if (use_aura) {
104     defines += [ "USE_AURA=1" ]
105   }
106   if (use_pango) {
107     defines += [ "USE_PANGO=1" ]
108   }
109   if (use_cairo) {
110     defines += [ "USE_CAIRO=1" ]
111   }
112   if (use_clipboard_aurax11) {
113     defines += [ "USE_CLIPBOARD_AURAX11=1" ]
114   }
115   if (use_default_render_theme) {
116     defines += [ "USE_DEFAULT_RENDER_THEME=1" ]
117   }
118   if (use_glib) {
119     defines += [ "USE_GLIB=1" ]
120   }
121   if (use_openssl) {
122     defines += [ "USE_OPENSSL=1" ]
123   }
124   if (use_openssl_certs) {
125     defines += [ "USE_OPENSSL_CERTS=1" ]
126   }
127   if (use_nss_certs) {
128     defines += [ "USE_NSS_CERTS=1" ]
129   }
130   if (use_ozone) {
131     defines += [ "USE_OZONE=1" ]
132   }
133   if (use_x11) {
134     defines += [ "USE_X11=1" ]
135   }
136   if (use_allocator != "tcmalloc") {
137     defines += [ "NO_TCMALLOC" ]
138   }
139   if (is_asan) {
140     defines += [
141       "ADDRESS_SANITIZER",
142       "MEMORY_TOOL_REPLACES_ALLOCATOR",
143       "MEMORY_SANITIZER_INITIAL_SIZE",
144     ]
145   }
146   if (enable_webrtc) {
147     defines += [ "ENABLE_WEBRTC=1" ]
148   }
149   if (disable_ftp_support) {
150     defines += [ "DISABLE_FTP_SUPPORT=1" ]
151   }
152   if (!enable_nacl) {
153     defines += [ "DISABLE_NACL" ]
154   }
155   if (enable_extensions) {
156     defines += [ "ENABLE_EXTENSIONS=1" ]
157   }
158   if (enable_configuration_policy) {
159     defines += [ "ENABLE_CONFIGURATION_POLICY" ]
160   }
161   if (enable_task_manager) {
162     defines += [ "ENABLE_TASK_MANAGER=1" ]
163   }
164   if (enable_themes) {
165     defines += [ "ENABLE_THEMES=1" ]
166   }
167   if (enable_captive_portal_detection) {
168     defines += [ "ENABLE_CAPTIVE_PORTAL_DETECTION=1" ]
169   }
170   if (enable_session_service) {
171     defines += [ "ENABLE_SESSION_SERVICE=1" ]
172   }
173   if (enable_rlz) {
174     defines += [ "ENABLE_RLZ" ]
175   }
176   if (enable_plugin_installation) {
177     defines += [ "ENABLE_PLUGIN_INSTALLATION=1" ]
178   }
179   if (enable_app_list) {
180     defines += [ "ENABLE_APP_LIST=1" ]
181   }
182   if (enable_settings_app) {
183     defines += [ "ENABLE_SETTINGS_APP=1" ]
184   }
185   if (enable_supervised_users) {
186     defines += [ "ENABLE_SUPERVISED_USERS=1" ]
187   }
188   if (enable_service_discovery) {
189     defines += [ "ENABLE_SERVICE_DISCOVERY=1" ]
190   }
191   if (enable_autofill_dialog) {
192     defines += [ "ENABLE_AUTOFILL_DIALOG=1" ]
193   }
194   if (enable_wifi_bootstrapping) {
195     defines += [ "ENABLE_WIFI_BOOTSTRAPPING=1" ]
196   }
197   if (enable_image_loader_extension) {
198     defines += [ "IMAGE_LOADER_EXTENSION=1" ]
199   }
200   if (enable_remoting) {
201     defines += [ "ENABLE_REMOTING=1" ]
202   }
203   if (enable_google_now) {
204     defines += [ "ENABLE_GOOGLE_NOW=1" ]
205   }
206   if (enable_one_click_signin) {
207     defines += [ "ENABLE_ONE_CLICK_SIGNIN" ]
208   }
209   if (enable_hidpi) {
210     defines += [ "ENABLE_HIDPI=1" ]
211   }
212   if (proprietary_codecs) {
213     defines += [ "USE_PROPRIETARY_CODECS" ]
214   }
215   if (enable_hangout_services_extension) {
216     defines += [ "ENABLE_HANGOUT_SERVICES_EXTENSION=1" ]
217   }
218   if (v8_use_external_startup_data) {
219     defines += [ "V8_USE_EXTERNAL_STARTUP_DATA" ]
220   }
221   if (enable_background) {
222     defines += [ "ENABLE_BACKGROUND=1" ]
223   }
224   if (enable_pre_sync_backup) {
225     defines += [ "ENABLE_PRE_SYNC_BACKUP" ]
226   }
227   if (enable_video_hole) {
228     defines += [ "VIDEO_HOLE=1" ]
229   }
230   if (safe_browsing_mode == 1) {
231     defines += [ "FULL_SAFE_BROWSING" ]
232     defines += [ "SAFE_BROWSING_CSD" ]
233     defines += [ "SAFE_BROWSING_DB_LOCAL" ]
234     defines += [ "SAFE_BROWSING_SERVICE" ]
235   } else if (safe_browsing_mode == 2) {
236     defines += [ "MOBILE_SAFE_BROWSING" ]
237     defines += [ "SAFE_BROWSING_SERVICE" ]
238   }
239   if (is_official_build) {
240     defines += [ "OFFICIAL_BUILD" ]
241   }
242   if (is_chrome_branded) {
243     defines += [ "GOOGLE_CHROME_BUILD" ]
244   } else {
245     defines += [ "CHROMIUM_BUILD" ]
246   }
249 # Debug/release ----------------------------------------------------------------
251 config("debug") {
252   defines = [
253     "_DEBUG",
254     "DYNAMIC_ANNOTATIONS_ENABLED=1",
255     "WTF_USE_DYNAMIC_ANNOTATIONS=1",
256   ]
258   if (is_nacl) {
259     defines += [ "DYNAMIC_ANNOTATIONS_PREFIX=NACL_" ]
260   }
262   if (is_win) {
263     if (disable_iterator_debugging) {
264       # Iterator debugging is enabled by the compiler on debug builds, and we
265       # have to tell it to turn it off.
266       defines += [ "_HAS_ITERATOR_DEBUGGING=0" ]
267     }
268   } else if (is_linux && !is_android && current_cpu == "x64" &&
269              !disable_iterator_debugging) {
270     # Enable libstdc++ debugging facilities to help catch problems early, see
271     # http://crbug.com/65151 .
272     # TODO(phajdan.jr): Should we enable this for all of POSIX?
273     defines += [ "_GLIBCXX_DEBUG=1" ]
274   }
277 config("release") {
278   defines = [ "NDEBUG" ]
280   # Sanitizers.
281   # TODO(GYP) The GYP build has "release_valgrind_build == 0" for this
282   # condition. When Valgrind is set up, we need to do the same here.
283   if (!is_tsan) {
284     defines += [ "NVALGRIND" ]
285     if (!is_nacl) {
286       # NaCl always enables dynamic annotations. Currently this value is set to
287       # 1 for all .nexes.
288       defines += [ "DYNAMIC_ANNOTATIONS_ENABLED=0" ]
289     }
290   }
293 # Default libraries ------------------------------------------------------------
295 # This config defines the default libraries applied to all targets.
296 config("default_libs") {
297   if (is_win) {
298     # TODO(brettw) this list of defaults should probably be smaller, and
299     # instead the targets that use the less common ones (e.g. wininet or
300     # winspool) should include those explicitly.
301     libs = [
302       "advapi32.lib",
303       "comdlg32.lib",
304       "dbghelp.lib",
305       "delayimp.lib",
306       "dnsapi.lib",
307       "gdi32.lib",
308       "kernel32.lib",
309       "msimg32.lib",
310       "odbc32.lib",
311       "odbccp32.lib",
312       "ole32.lib",
313       "oleaut32.lib",
314       "psapi.lib",
315       "shell32.lib",
316       "shlwapi.lib",
317       "user32.lib",
318       "usp10.lib",
319       "uuid.lib",
320       "version.lib",
321       "wininet.lib",
322       "winmm.lib",
323       "winspool.lib",
324       "ws2_32.lib",
326       # Please don't add more stuff here. We should actually be making this
327       # list smaller, since all common things should be covered. If you need
328       # some extra libraries, please just add a libs = [ "foo.lib" ] to your
329       # target that needs it.
330     ]
331   } else if (is_android) {
332     # Android uses -nostdlib so we need to add even libc here.
333     libs = [
334       # TODO(brettw) write a version of this, hopefully we can express this
335       # without forking out to GCC just to get the library name. The android
336       # toolchain directory should probably be extracted into a .gni file that
337       # this file and the android toolchain .gn file can share.
338       #   # Manually link the libgcc.a that the cross compiler uses.
339       #   '<!(<(android_toolchain)/*-gcc -print-libgcc-file-name)',
340       "c",
341       "dl",
342       "m",
343     ]
344   } else if (is_mac) {
345     libs = [
346       "AppKit.framework",
347       "ApplicationServices.framework",
348       "Carbon.framework",
349       "CoreFoundation.framework",
350       "Foundation.framework",
351       "IOKit.framework",
352       "Security.framework",
353     ]
354   } else if (is_ios) {
355     libs = [
356       "CoreFoundation.framework",
357       "CoreGraphics.framework",
358       "CoreText.framework",
359       "Foundation.framework",
360       "UIKit.framework",
361     ]
362   } else if (is_linux) {
363     libs = [ "dl" ]
364   }