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_ONE_CLICK_SIGNIN",
36 "ENABLE_CONFIGURATION_POLICY",
37 "ENABLE_NOTIFICATIONS",
39 "ENABLE_TASK_MANAGER=1",
40 "ENABLE_PLUGIN_INSTALLATION=1",
41 "ENABLE_SESSION_SERVICE=1",
43 "ENABLE_AUTOFILL_DIALOG=1",
44 "ENABLE_BACKGROUND=1",
45 "ENABLE_GOOGLE_NOW=1",
46 "ENABLE_CAPTIVE_PORTAL_DETECTION=1",
48 "ENABLE_SETTINGS_APP=1",
49 "ENABLE_MANAGED_USERS=1",
50 "ENABLE_SERVICE_DISCOVERY=1",
52 "V8_DEPRECATION_WARNINGS", # Don't use deprecated V8 APIs anywhere.
53 # Temporary suppression until Blink code can be removed.
54 "BLINK_SCALE_FILTERS_AT_RECORD_TIME",
57 if (cld_version > 0) {
58 defines += [ "CLD_VERSION=$cld_version" ]
61 defines += [ "ENABLE_MDNS=1" ]
63 if (enable_pepper_cdms) {
64 # TODO(brettw) should probably be "=1"
65 defines += [ "ENABLE_PEPPER_CDMS" ]
68 defines += [ "ENABLE_PLUGINS=1" ]
70 if (enable_printing > 0) {
71 defines += [ "ENABLE_PRINTING=1" ]
72 if (enable_printing < 2) {
73 defines += [ "ENABLE_FULL_PRINTING=1" ]
76 if (enable_spellcheck) {
77 defines += [ "ENABLE_SPELLCHECK=1" ]
79 if (dont_embed_build_metadata) {
80 defines += [ "DONT_EMBED_BUILD_METADATA" ]
83 # TODO(brettw) should probably be "=1".
84 defines += [ "USE_UDEV" ]
87 defines += [ "TOOLKIT_VIEWS=1" ]
89 if (ui_compositor_image_transport) {
90 # TODO(brettw) should probably be "=1".
91 defines += [ "UI_COMPOSITOR_IMAGE_TRANSPORT" ]
94 defines += [ "USE_ASH=1" ]
97 defines += [ "USE_AURA=1" ]
100 defines += [ "USE_CAIRO=1" ]
102 if (use_clipboard_aurax11) {
103 defines += [ "USE_CLIPBOARD_AURAX11=1" ]
105 if (use_default_render_theme) {
106 defines += [ "USE_DEFAULT_RENDER_THEME=1" ]
109 defines += [ "USE_GLIB=1" ]
112 defines += [ "USE_OPENSSL=1" ]
113 if (use_openssl_certs) {
114 defines += [ "USE_OPENSSL_CERTS=1" ]
116 } else if (use_nss_certs) {
117 # USE_NSS really means "use nss for certificate validation and storage"
118 # (like USE_OPENSSL_CERTS) and not "we're linking to NSS." It might be nice
119 # to rename this but we're hoping to transition away from NSS.
120 defines += [ "USE_NSS=1" ]
123 defines += [ "USE_OZONE=1" ]
126 defines += [ "USE_X11=1" ]
127 if (use_xi2_mt > 0) {
128 defines += [ "USE_XI2_MT=$use_xi2_mt" ]
131 if (use_allocator != "tcmalloc") {
132 defines += [ "NO_TCMALLOC" ]
135 defines += [ "ENABLE_WEBRTC=1" ]
137 if (disable_ftp_support) {
138 defines += [ "DISABLE_FTP_SUPPORT=1" ]
141 defines += [ "DISABLE_NACL" ]
143 if (enable_extensions) {
144 defines += [ "ENABLE_EXTENSIONS=1" ]
148 # Debug/release ----------------------------------------------------------------
153 "DYNAMIC_ANNOTATIONS_ENABLED=1",
154 "WTF_USE_DYNAMIC_ANNOTATIONS=1",
158 if (disable_iterator_debugging) {
159 # Iterator debugging is enabled by the compiler on debug builds, and we
160 # have to tell it to turn it off.
161 defines += [ "_HAS_ITERATOR_DEBUGGING=0" ]
163 } else if (is_linux && !is_android && cpu_arch == "x64" &&
164 !disable_iterator_debugging) {
165 # Enable libstdc++ debugging facilities to help catch problems early, see
166 # http://crbug.com/65151 .
167 # TODO(phajdan.jr): Should we enable this for all of POSIX?
168 defines += [ "_GLIBCXX_DEBUG=1" ]
175 # Default libraries ------------------------------------------------------------
177 # This config defines the default libraries applied to all targets.
178 config("default_libs") {
180 # TODO(brettw) this list of defaults should probably be smaller, and
181 # instead the targets that use the less common ones (e.g. wininet or
182 # winspool) should include those explicitly.
207 # Please don't add more stuff here. We should actually be making this
208 # list smaller, since all common things should be covered. If you need
209 # some extra libraries, please just add a libs = [ "foo.lib" ] to your
210 # target that needs it.
212 } else if (is_android) {
213 # Android uses -nostdlib so we need to add even libc here.
215 # TODO(brettw) write a version of this, hopefully we can express this
216 # without forking out to GCC just to get the library name. The android
217 # toolchain directory should probably be extracted into a .gni file that
218 # this file and the android toolchain .gn file can share.
219 # # Manually link the libgcc.a that the cross compiler uses.
220 # '<!(<(android_toolchain)/*-gcc -print-libgcc-file-name)',
228 "ApplicationServices.framework",
230 "CoreFoundation.framework",
231 "Foundation.framework",
233 "Security.framework",
237 "CoreFoundation.framework",
238 "CoreGraphics.framework",
239 "CoreText.framework",
240 "Foundation.framework",
243 } else if (is_linux) {