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.
35 "ENABLE_BACKGROUND=1",
36 "V8_DEPRECATION_WARNINGS", # Don't use deprecated V8 APIs anywhere.
39 if (cld_version > 0) {
40 defines += [ "CLD_VERSION=$cld_version" ]
43 defines += [ "ENABLE_MDNS=1" ]
45 if (enable_notifications) {
46 defines += [ "ENABLE_NOTIFICATIONS" ]
48 if (enable_pepper_cdms) {
49 # TODO(brettw) should probably be "=1"
50 defines += [ "ENABLE_PEPPER_CDMS" ]
52 if (enable_browser_cdms) {
53 # TODO(brettw) should probably be "=1"
54 defines += [ "ENABLE_BROWSER_CDMS" ]
57 defines += [ "ENABLE_PLUGINS=1" ]
59 if (printing_mode > 0) {
60 defines += [ "ENABLE_PRINTING=1" ]
61 if (printing_mode < 2) {
62 defines += [ "ENABLE_FULL_PRINTING=1" ]
65 if (enable_spellcheck) {
66 defines += [ "ENABLE_SPELLCHECK=1" ]
68 if (dont_embed_build_metadata) {
69 defines += [ "DONT_EMBED_BUILD_METADATA" ]
72 # TODO(brettw) should probably be "=1".
73 defines += [ "USE_UDEV" ]
76 defines += [ "TOOLKIT_VIEWS=1" ]
78 if (ui_compositor_image_transport) {
79 # TODO(brettw) should probably be "=1".
80 defines += [ "UI_COMPOSITOR_IMAGE_TRANSPORT" ]
83 defines += [ "USE_ASH=1" ]
86 defines += [ "USE_AURA=1" ]
89 defines += [ "USE_CAIRO=1" ]
91 if (use_clipboard_aurax11) {
92 defines += [ "USE_CLIPBOARD_AURAX11=1" ]
94 if (use_default_render_theme) {
95 defines += [ "USE_DEFAULT_RENDER_THEME=1" ]
98 defines += [ "USE_GLIB=1" ]
101 defines += [ "USE_OPENSSL=1" ]
102 if (use_openssl_certs) {
103 defines += [ "USE_OPENSSL_CERTS=1" ]
105 } else if (use_nss_certs) {
106 # USE_NSS really means "use nss for certificate validation and storage"
107 # (like USE_OPENSSL_CERTS) and not "we're linking to NSS." It might be nice
108 # to rename this but we're hoping to transition away from NSS.
109 defines += [ "USE_NSS=1" ]
112 defines += [ "USE_OZONE=1" ]
115 defines += [ "USE_X11=1" ]
116 if (use_xi2_mt > 0) {
117 defines += [ "USE_XI2_MT=$use_xi2_mt" ]
120 if (use_allocator != "tcmalloc") {
121 defines += [ "NO_TCMALLOC" ]
124 defines += [ "ENABLE_WEBRTC=1" ]
126 if (disable_ftp_support) {
127 defines += [ "DISABLE_FTP_SUPPORT=1" ]
130 defines += [ "DISABLE_NACL" ]
132 if (enable_extensions) {
133 defines += [ "ENABLE_EXTENSIONS=1" ]
135 if (enable_configuration_policy) {
136 defines += [ "ENABLE_CONFIGURATION_POLICY" ]
138 if (enable_task_manager) {
139 defines += [ "ENABLE_TASK_MANAGER=1" ]
142 defines += [ "ENABLE_THEMES=1" ]
144 if (enable_captive_portal_detection) {
145 defines += [ "ENABLE_CAPTIVE_PORTAL_DETECTION=1" ]
147 if (enable_session_service) {
148 defines += [ "ENABLE_SESSION_SERVICE=1" ]
151 defines += [ "ENABLE_RLZ" ]
153 if (enable_plugin_installation) {
154 defines += [ "ENABLE_PLUGIN_INSTALLATION=1" ]
156 if (enable_app_list) {
157 defines += [ "ENABLE_APP_LIST=1" ]
159 if (enable_settings_app) {
160 defines += [ "ENABLE_SETTINGS_APP=1" ]
162 if (enable_managed_users) {
163 defines += [ "ENABLE_MANAGED_USERS=1" ]
165 if (enable_service_discovery) {
166 defines += [ "ENABLE_SERVICE_DISCOVERY=1" ]
168 if (enable_autofill_dialog) {
169 defines += [ "ENABLE_AUTOFILL_DIALOG=1" ]
171 if (enable_wifi_bootstrapping) {
172 defines += [ "ENABLE_WIFI_BOOTSTRAPPING=1" ]
174 if (enable_image_loader_extension) {
175 defines += [ "IMAGE_LOADER_EXTENSION=1" ]
177 if (enable_remoting) {
178 defines += [ "ENABLE_REMOTING=1" ]
180 if (enable_google_now) {
181 defines += [ "ENABLE_GOOGLE_NOW=1" ]
183 if (enable_one_click_signin) {
184 defines += [ "ENABLE_ONE_CLICK_SIGNIN" ]
187 defines += [ "USE_ATHENA=1" ]
190 defines += [ "ENABLE_HIDPI=1" ]
194 # Debug/release ----------------------------------------------------------------
199 "DYNAMIC_ANNOTATIONS_ENABLED=1",
200 "WTF_USE_DYNAMIC_ANNOTATIONS=1",
204 if (disable_iterator_debugging) {
205 # Iterator debugging is enabled by the compiler on debug builds, and we
206 # have to tell it to turn it off.
207 defines += [ "_HAS_ITERATOR_DEBUGGING=0" ]
209 } else if (is_linux && !is_android && cpu_arch == "x64" &&
210 !disable_iterator_debugging) {
211 # Enable libstdc++ debugging facilities to help catch problems early, see
212 # http://crbug.com/65151 .
213 # TODO(phajdan.jr): Should we enable this for all of POSIX?
214 defines += [ "_GLIBCXX_DEBUG=1" ]
224 # Default libraries ------------------------------------------------------------
226 # This config defines the default libraries applied to all targets.
227 config("default_libs") {
229 # TODO(brettw) this list of defaults should probably be smaller, and
230 # instead the targets that use the less common ones (e.g. wininet or
231 # winspool) should include those explicitly.
256 # Please don't add more stuff here. We should actually be making this
257 # list smaller, since all common things should be covered. If you need
258 # some extra libraries, please just add a libs = [ "foo.lib" ] to your
259 # target that needs it.
261 } else if (is_android) {
262 # Android uses -nostdlib so we need to add even libc here.
264 # TODO(brettw) write a version of this, hopefully we can express this
265 # without forking out to GCC just to get the library name. The android
266 # toolchain directory should probably be extracted into a .gni file that
267 # this file and the android toolchain .gn file can share.
268 # # Manually link the libgcc.a that the cross compiler uses.
269 # '<!(<(android_toolchain)/*-gcc -print-libgcc-file-name)',
277 "ApplicationServices.framework",
279 "CoreFoundation.framework",
280 "Foundation.framework",
282 "Security.framework",
286 "CoreFoundation.framework",
287 "CoreGraphics.framework",
288 "CoreText.framework",
289 "Foundation.framework",
292 } else if (is_linux) {