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/crypto.gni")
6 import("//build/config/features.gni")
7 import("//build/config/ui.gni")
10 # When set, turns off the (normally-on) iterator debugging and related stuff
11 # that is normally turned on for Debug builds. These are generally useful for
12 # catching bugs but in some cases may cause conflicts or excessive slowness.
13 disable_iterator_debugging = false
16 # TODO(brettw) Most of these should be removed. Instead of global feature
17 # flags, we should have more modular flags that apply only to a target and its
18 # dependents. For example, depending on the "x11" meta-target should define
19 # USE_X11 for all dependents so that everything that could use X11 gets the
20 # define, but anything that doesn't depend on X11 doesn't see it.
22 # For now we define these globally to match the current GYP build.
23 config("feature_flags") {
24 # TODO(brettw) most of these need to be parameterized.
27 "ENABLE_ONE_CLICK_SIGNIN",
30 "ENABLE_CONFIGURATION_POLICY",
31 "ENABLE_NOTIFICATIONS",
33 "ENABLE_TASK_MANAGER=1",
34 "ENABLE_EXTENSIONS=1",
35 "ENABLE_PLUGIN_INSTALLATION=1",
36 "ENABLE_SESSION_SERVICE=1",
38 "ENABLE_AUTOFILL_DIALOG=1",
39 "ENABLE_BACKGROUND=1",
40 "ENABLE_GOOGLE_NOW=1",
41 "ENABLE_CAPTIVE_PORTAL_DETECTION=1",
43 "ENABLE_SETTINGS_APP=1",
44 "ENABLE_MANAGED_USERS=1",
45 "ENABLE_SERVICE_DISCOVERY=1",
47 "V8_DEPRECATION_WARNINGS", # Don't use deprecated V8 APIs anywhere.
48 # Temporary suppression until Blink code can be removed.
49 "BLINK_SCALE_FILTERS_AT_RECORD_TIME",
52 if (cld_version > 0) {
53 defines += [ "CLD_VERSION=$cld_version" ]
56 defines += [ "ENABLE_MDNS=1" ]
58 if (enable_pepper_cdms) {
59 # TODO(brettw) should probably be "=1"
60 defines += [ "ENABLE_PEPPER_CDMS" ]
63 defines += [ "ENABLE_PLUGINS=1" ]
65 if (enable_printing > 0) {
66 defines += [ "ENABLE_PRINTING=1" ]
67 if (enable_printing < 2) {
68 defines += [ "ENABLE_FULL_PRINTING=1" ]
71 if (enable_spellcheck) {
72 defines += [ "ENABLE_SPELLCHECK=1" ]
75 # TODO(brettw) should probably be "=1".
76 defines += [ "USE_UDEV" ]
79 defines += [ "TOOLKIT_VIEWS=1" ]
81 if (ui_compositor_image_transport) {
82 # TODO(brettw) should probably be "=1".
83 defines += [ "UI_COMPOSITOR_IMAGE_TRANSPORT" ]
86 defines += [ "USE_ASH=1" ]
89 defines += [ "USE_AURA=1" ]
92 defines += [ "USE_CAIRO=1" ]
94 if (use_clipboard_aurax11) {
95 defines += [ "USE_CLIPBOARD_AURAX11=1" ]
97 if (use_default_render_theme) {
98 defines += [ "USE_DEFAULT_RENDER_THEME=1" ]
101 defines += [ "USE_GLIB=1" ]
104 defines += [ "USE_OPENSSL=1" ]
105 if (use_openssl_certs) {
106 defines += [ "USE_OPENSSL_CERTS=1" ]
108 } else if (use_nss_certs) {
109 # USE_NSS really means "use nss for certificate validation and storage"
110 # (like USE_OPENSSL_CERTS) and not "we're linking to NSS." It might be nice
111 # to rename this but we're hoping to transition away from NSS.
112 defines += [ "USE_NSS=1" ]
115 defines += [ "USE_OZONE=1" ]
118 defines += [ "USE_X11=1" ]
119 if (use_xi2_mt > 0) {
120 defines += [ "USE_XI2_MT=$use_xi2_mt" ]
125 # Debug/release ----------------------------------------------------------------
130 "DYNAMIC_ANNOTATIONS_ENABLED=1",
131 "WTF_USE_DYNAMIC_ANNOTATIONS=1",
135 if (disable_iterator_debugging) {
136 # Iterator debugging is enabled by the compiler on debug builds, and we
137 # have to tell it to turn it off.
138 defines += [ "_HAS_ITERATOR_DEBUGGING=0" ]
140 } else if (is_linux && !is_android && cpu_arch == "x64" &&
141 !disable_iterator_debugging) {
142 # Enable libstdc++ debugging facilities to help catch problems early, see
143 # http://crbug.com/65151 .
144 # TODO(phajdan.jr): Should we enable this for all of POSIX?
145 defines += [ "_GLIBCXX_DEBUG=1" ]
152 # Default libraries ------------------------------------------------------------
154 # This config defines the default libraries applied to all targets.
155 config("default_libs") {
157 # TODO(brettw) this list of defaults should probably be smaller, and
158 # instead the targets that use the less common ones (e.g. wininet or
159 # winspool) should include those explicitly.
184 # Please don't add more stuff here. We should actually be making this
185 # list smaller, since all common things should be covered. If you need
186 # some extra libraries, please just add a libs = [ "foo.lib" ] to your
187 # target that needs it.
189 } else if (is_android) {
190 # Android uses -nostdlib so we need to add even libc here.
192 # TODO(brettw) write a version of this, hopefully we can express this
193 # without forking out to GCC just to get the library name. The android
194 # toolchain directory should probably be extracted into a .gni file that
195 # this file and the android toolchain .gn file can share.
196 # # Manually link the libgcc.a that the cross compiler uses.
197 # '<!(<(android_toolchain)/*-gcc -print-libgcc-file-name)',
205 "ApplicationServices.framework",
207 "CoreFoundation.framework",
208 "Foundation.framework",
210 "Security.framework",
214 "CoreFoundation.framework",
215 "CoreGraphics.framework",
216 "CoreText.framework",
217 "Foundation.framework",
220 } else if (is_linux) {