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 "ENABLE_NOTIFICATIONS",
36 "ENABLE_BACKGROUND=1",
37 "V8_DEPRECATION_WARNINGS", # Don't use deprecated V8 APIs anywhere.
40 if (cld_version > 0) {
41 defines += [ "CLD_VERSION=$cld_version" ]
44 defines += [ "ENABLE_MDNS=1" ]
46 if (enable_pepper_cdms) {
47 # TODO(brettw) should probably be "=1"
48 defines += [ "ENABLE_PEPPER_CDMS" ]
51 defines += [ "ENABLE_PLUGINS=1" ]
53 if (printing_mode > 0) {
54 defines += [ "ENABLE_PRINTING=1" ]
55 if (printing_mode < 2) {
56 defines += [ "ENABLE_FULL_PRINTING=1" ]
59 if (enable_spellcheck) {
60 defines += [ "ENABLE_SPELLCHECK=1" ]
62 if (dont_embed_build_metadata) {
63 defines += [ "DONT_EMBED_BUILD_METADATA" ]
66 # TODO(brettw) should probably be "=1".
67 defines += [ "USE_UDEV" ]
70 defines += [ "TOOLKIT_VIEWS=1" ]
72 if (ui_compositor_image_transport) {
73 # TODO(brettw) should probably be "=1".
74 defines += [ "UI_COMPOSITOR_IMAGE_TRANSPORT" ]
77 defines += [ "USE_ASH=1" ]
80 defines += [ "USE_AURA=1" ]
83 defines += [ "USE_CAIRO=1" ]
85 if (use_clipboard_aurax11) {
86 defines += [ "USE_CLIPBOARD_AURAX11=1" ]
88 if (use_default_render_theme) {
89 defines += [ "USE_DEFAULT_RENDER_THEME=1" ]
92 defines += [ "USE_GLIB=1" ]
95 defines += [ "USE_OPENSSL=1" ]
96 if (use_openssl_certs) {
97 defines += [ "USE_OPENSSL_CERTS=1" ]
99 } else if (use_nss_certs) {
100 # USE_NSS really means "use nss for certificate validation and storage"
101 # (like USE_OPENSSL_CERTS) and not "we're linking to NSS." It might be nice
102 # to rename this but we're hoping to transition away from NSS.
103 defines += [ "USE_NSS=1" ]
106 defines += [ "USE_OZONE=1" ]
109 defines += [ "USE_X11=1" ]
110 if (use_xi2_mt > 0) {
111 defines += [ "USE_XI2_MT=$use_xi2_mt" ]
114 if (use_allocator != "tcmalloc") {
115 defines += [ "NO_TCMALLOC" ]
118 defines += [ "ENABLE_WEBRTC=1" ]
120 if (disable_ftp_support) {
121 defines += [ "DISABLE_FTP_SUPPORT=1" ]
124 defines += [ "DISABLE_NACL" ]
126 if (enable_extensions) {
127 defines += [ "ENABLE_EXTENSIONS=1" ]
129 if (enable_configuration_policy) {
130 defines += [ "ENABLE_CONFIGURATION_POLICY" ]
132 if (enable_task_manager) {
133 defines += [ "ENABLE_TASK_MANAGER=1" ]
136 defines += [ "ENABLE_THEMES=1" ]
138 if (is_win && win_pdf_metafile_for_printing) {
139 defines += [ "WIN_PDF_METAFILE_FOR_PRINTING=1" ]
141 if (enable_captive_portal_detection) {
142 defines += [ "ENABLE_CAPTIVE_PORTAL_DETECTION=1" ]
144 if (enable_session_service) {
145 defines += [ "ENABLE_SESSION_SERVICE=1" ]
148 defines += [ "ENABLE_RLZ" ]
150 if (enable_plugin_installation) {
151 defines += [ "ENABLE_PLUGIN_INSTALLATION=1" ]
153 if (enable_app_list) {
154 defines += [ "ENABLE_APP_LIST=1" ]
156 if (enable_settings_app) {
157 defines += [ "ENABLE_SETTINGS_APP=1" ]
159 if (enable_managed_users) {
160 defines += [ "ENABLE_MANAGED_USERS=1" ]
162 if (enable_service_discovery) {
163 defines += [ "ENABLE_SERVICE_DISCOVERY=1" ]
165 if (enable_autofill_dialog) {
166 defines += [ "ENABLE_AUTOFILL_DIALOG=1" ]
168 if (enable_wifi_bootstrapping) {
169 defines += [ "ENABLE_WIFI_BOOTSTRAPPING=1" ]
171 if (enable_image_loader_extension) {
172 defines += [ "IMAGE_LOADER_EXTENSION=1" ]
174 if (enable_remoting) {
175 defines += [ "ENABLE_REMOTING=1" ]
177 if (enable_google_now) {
178 defines += [ "ENABLE_GOOGLE_NOW=1" ]
180 if (enable_one_click_signin) {
181 defines += [ "ENABLE_ONE_CLICK_SIGNIN" ]
185 # Debug/release ----------------------------------------------------------------
190 "DYNAMIC_ANNOTATIONS_ENABLED=1",
191 "WTF_USE_DYNAMIC_ANNOTATIONS=1",
195 if (disable_iterator_debugging) {
196 # Iterator debugging is enabled by the compiler on debug builds, and we
197 # have to tell it to turn it off.
198 defines += [ "_HAS_ITERATOR_DEBUGGING=0" ]
200 } else if (is_linux && !is_android && cpu_arch == "x64" &&
201 !disable_iterator_debugging) {
202 # Enable libstdc++ debugging facilities to help catch problems early, see
203 # http://crbug.com/65151 .
204 # TODO(phajdan.jr): Should we enable this for all of POSIX?
205 defines += [ "_GLIBCXX_DEBUG=1" ]
212 # Default libraries ------------------------------------------------------------
214 # This config defines the default libraries applied to all targets.
215 config("default_libs") {
217 # TODO(brettw) this list of defaults should probably be smaller, and
218 # instead the targets that use the less common ones (e.g. wininet or
219 # winspool) should include those explicitly.
244 # Please don't add more stuff here. We should actually be making this
245 # list smaller, since all common things should be covered. If you need
246 # some extra libraries, please just add a libs = [ "foo.lib" ] to your
247 # target that needs it.
249 } else if (is_android) {
250 # Android uses -nostdlib so we need to add even libc here.
252 # TODO(brettw) write a version of this, hopefully we can express this
253 # without forking out to GCC just to get the library name. The android
254 # toolchain directory should probably be extracted into a .gni file that
255 # this file and the android toolchain .gn file can share.
256 # # Manually link the libgcc.a that the cross compiler uses.
257 # '<!(<(android_toolchain)/*-gcc -print-libgcc-file-name)',
265 "ApplicationServices.framework",
267 "CoreFoundation.framework",
268 "Foundation.framework",
270 "Security.framework",
274 "CoreFoundation.framework",
275 "CoreGraphics.framework",
276 "CoreText.framework",
277 "Foundation.framework",
280 } else if (is_linux) {