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/crypto.gni")
7 import("//build/config/features.gni")
8 import("//build/config/ui.gni")
11 # When set, turns off the (normally-on) iterator debugging and related stuff
12 # that is normally turned on for Debug builds. These are generally useful for
13 # catching bugs but in some cases may cause conflicts or excessive slowness.
14 disable_iterator_debugging = false
16 # Set to true to not store any build metadata (this isn't working yet but
17 # this flag will help us to get there). See http://crbug.com/314403.
18 # TODO(sebmarchand): Update this comment once this flag guarantee that
19 # there's no build metadata in the build artifacts.
20 dont_embed_build_metadata = false
23 # TODO(brettw) Most of these should be removed. Instead of global feature
24 # flags, we should have more modular flags that apply only to a target and its
25 # dependents. For example, depending on the "x11" meta-target should define
26 # USE_X11 for all dependents so that everything that could use X11 gets the
27 # define, but anything that doesn't depend on X11 doesn't see it.
29 # For now we define these globally to match the current GYP build.
30 config("feature_flags") {
31 # TODO(brettw) most of these need to be parameterized.
34 "V8_DEPRECATION_WARNINGS", # Don't use deprecated V8 APIs anywhere.
37 if (cld_version > 0) {
38 defines += [ "CLD_VERSION=$cld_version" ]
41 defines += [ "ENABLE_MDNS=1" ]
43 if (enable_notifications) {
44 defines += [ "ENABLE_NOTIFICATIONS" ]
46 if (enable_pepper_cdms) {
47 # TODO(brettw) should probably be "=1"
48 defines += [ "ENABLE_PEPPER_CDMS" ]
50 if (enable_browser_cdms) {
51 # TODO(brettw) should probably be "=1"
52 defines += [ "ENABLE_BROWSER_CDMS" ]
55 defines += [ "ENABLE_PLUGINS=1" ]
57 if (enable_basic_printing || enable_print_preview) {
58 # Convenience define for ENABLE_BASIC_PRINTING || ENABLE_PRINT_PREVIEW.
59 defines += [ "ENABLE_PRINTING=1" ]
60 if (enable_basic_printing) {
61 # Enable basic printing support and UI.
62 defines += [ "ENABLE_BASIC_PRINTING=1" ]
64 if (enable_print_preview) {
65 # Enable printing with print preview.
66 # Can be defined without ENABLE_BASIC_PRINTING.
67 defines += [ "ENABLE_PRINT_PREVIEW=1" ]
70 if (enable_spellcheck) {
71 defines += [ "ENABLE_SPELLCHECK=1" ]
73 if (dont_embed_build_metadata) {
74 defines += [ "DONT_EMBED_BUILD_METADATA" ]
77 # TODO(brettw) should probably be "=1".
78 defines += [ "USE_UDEV" ]
81 defines += [ "TOOLKIT_VIEWS=1" ]
83 if (ui_compositor_image_transport) {
84 # TODO(brettw) should probably be "=1".
85 defines += [ "UI_COMPOSITOR_IMAGE_TRANSPORT" ]
88 defines += [ "USE_ASH=1" ]
91 defines += [ "USE_AURA=1" ]
94 defines += [ "USE_PANGO=1" ]
97 defines += [ "USE_CAIRO=1" ]
99 if (use_clipboard_aurax11) {
100 defines += [ "USE_CLIPBOARD_AURAX11=1" ]
102 if (use_default_render_theme) {
103 defines += [ "USE_DEFAULT_RENDER_THEME=1" ]
106 defines += [ "USE_GLIB=1" ]
109 defines += [ "USE_OPENSSL=1" ]
110 if (use_openssl_certs) {
111 defines += [ "USE_OPENSSL_CERTS=1" ]
113 } else if (use_nss_certs) {
114 # USE_NSS really means "use nss for certificate validation and storage"
115 # (like USE_OPENSSL_CERTS) and not "we're linking to NSS." It might be nice
116 # to rename this but we're hoping to transition away from NSS.
117 defines += [ "USE_NSS=1" ]
120 defines += [ "USE_OZONE=1" ]
123 defines += [ "USE_X11=1" ]
125 if (use_allocator != "tcmalloc") {
126 defines += [ "NO_TCMALLOC" ]
131 "MEMORY_TOOL_REPLACES_ALLOCATOR",
132 "MEMORY_SANITIZER_INITIAL_SIZE",
136 defines += [ "ENABLE_WEBRTC=1" ]
138 if (disable_ftp_support) {
139 defines += [ "DISABLE_FTP_SUPPORT=1" ]
142 defines += [ "DISABLE_NACL" ]
144 if (enable_extensions) {
145 defines += [ "ENABLE_EXTENSIONS=1" ]
147 if (enable_configuration_policy) {
148 defines += [ "ENABLE_CONFIGURATION_POLICY" ]
150 if (enable_task_manager) {
151 defines += [ "ENABLE_TASK_MANAGER=1" ]
154 defines += [ "ENABLE_THEMES=1" ]
156 if (enable_captive_portal_detection) {
157 defines += [ "ENABLE_CAPTIVE_PORTAL_DETECTION=1" ]
159 if (enable_session_service) {
160 defines += [ "ENABLE_SESSION_SERVICE=1" ]
163 defines += [ "ENABLE_RLZ" ]
165 if (enable_plugin_installation) {
166 defines += [ "ENABLE_PLUGIN_INSTALLATION=1" ]
168 if (enable_app_list) {
169 defines += [ "ENABLE_APP_LIST=1" ]
171 if (enable_settings_app) {
172 defines += [ "ENABLE_SETTINGS_APP=1" ]
174 if (enable_managed_users) {
175 defines += [ "ENABLE_MANAGED_USERS=1" ]
177 if (enable_service_discovery) {
178 defines += [ "ENABLE_SERVICE_DISCOVERY=1" ]
180 if (enable_autofill_dialog) {
181 defines += [ "ENABLE_AUTOFILL_DIALOG=1" ]
183 if (enable_wifi_bootstrapping) {
184 defines += [ "ENABLE_WIFI_BOOTSTRAPPING=1" ]
186 if (enable_image_loader_extension) {
187 defines += [ "IMAGE_LOADER_EXTENSION=1" ]
189 if (enable_remoting) {
190 defines += [ "ENABLE_REMOTING=1" ]
192 if (enable_google_now) {
193 defines += [ "ENABLE_GOOGLE_NOW=1" ]
195 if (enable_one_click_signin) {
196 defines += [ "ENABLE_ONE_CLICK_SIGNIN" ]
199 defines += [ "USE_ATHENA=1" ]
202 defines += [ "ENABLE_HIDPI=1" ]
204 if (proprietary_codecs) {
205 defines += [ "USE_PROPRIETARY_CODECS" ]
209 # Debug/release ----------------------------------------------------------------
214 "DYNAMIC_ANNOTATIONS_ENABLED=1",
215 "WTF_USE_DYNAMIC_ANNOTATIONS=1",
219 if (disable_iterator_debugging) {
220 # Iterator debugging is enabled by the compiler on debug builds, and we
221 # have to tell it to turn it off.
222 defines += [ "_HAS_ITERATOR_DEBUGGING=0" ]
224 } else if (is_linux && !is_android && cpu_arch == "x64" &&
225 !disable_iterator_debugging) {
226 # Enable libstdc++ debugging facilities to help catch problems early, see
227 # http://crbug.com/65151 .
228 # TODO(phajdan.jr): Should we enable this for all of POSIX?
229 defines += [ "_GLIBCXX_DEBUG=1" ]
239 # Default libraries ------------------------------------------------------------
241 # This config defines the default libraries applied to all targets.
242 config("default_libs") {
244 # TODO(brettw) this list of defaults should probably be smaller, and
245 # instead the targets that use the less common ones (e.g. wininet or
246 # winspool) should include those explicitly.
271 # Please don't add more stuff here. We should actually be making this
272 # list smaller, since all common things should be covered. If you need
273 # some extra libraries, please just add a libs = [ "foo.lib" ] to your
274 # target that needs it.
276 } else if (is_android) {
277 # Android uses -nostdlib so we need to add even libc here.
279 # TODO(brettw) write a version of this, hopefully we can express this
280 # without forking out to GCC just to get the library name. The android
281 # toolchain directory should probably be extracted into a .gni file that
282 # this file and the android toolchain .gn file can share.
283 # # Manually link the libgcc.a that the cross compiler uses.
284 # '<!(<(android_toolchain)/*-gcc -print-libgcc-file-name)',
292 "ApplicationServices.framework",
294 "CoreFoundation.framework",
295 "Foundation.framework",
297 "Security.framework",
301 "CoreFoundation.framework",
302 "CoreGraphics.framework",
303 "CoreText.framework",
304 "Foundation.framework",
307 } else if (is_linux) {