Explicitly add python-numpy dependency to install-build-deps.
[chromium-blink-merge.git] / build / config / BUILD.gn
blobc51709c24ce97419a6be64241c616917c635e477
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")
10 declare_args() {
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.
32   defines = [
33       "CHROMIUM_BUILD",
34       "V8_DEPRECATION_WARNINGS",  # Don't use deprecated V8 APIs anywhere.
35   ]
37   if (cld_version > 0) {
38     defines += [ "CLD_VERSION=$cld_version" ]
39   }
40   if (enable_mdns) {
41     defines += [ "ENABLE_MDNS=1" ]
42   }
43   if (enable_notifications) {
44     defines += [ "ENABLE_NOTIFICATIONS" ]
45   }
46   if (enable_pepper_cdms) {
47     # TODO(brettw) should probably be "=1"
48     defines += [ "ENABLE_PEPPER_CDMS" ]
49   }
50   if (enable_browser_cdms) {
51     # TODO(brettw) should probably be "=1"
52     defines += [ "ENABLE_BROWSER_CDMS" ]
53   }
54   if (enable_plugins) {
55     defines += [ "ENABLE_PLUGINS=1" ]
56   }
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" ]
63     }
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" ]
68     }
69   }
70   if (enable_spellcheck) {
71     defines += [ "ENABLE_SPELLCHECK=1" ]
72   }
73   if (dont_embed_build_metadata) {
74     defines += [ "DONT_EMBED_BUILD_METADATA" ]
75   }
76   if (use_udev) {
77     # TODO(brettw) should probably be "=1".
78     defines += [ "USE_UDEV" ]
79   }
80   if (toolkit_views) {
81     defines += [ "TOOLKIT_VIEWS=1" ]
82   }
83   if (ui_compositor_image_transport) {
84     # TODO(brettw) should probably be "=1".
85     defines += [ "UI_COMPOSITOR_IMAGE_TRANSPORT" ]
86   }
87   if (use_ash) {
88     defines += [ "USE_ASH=1" ]
89   }
90   if (use_aura) {
91     defines += [ "USE_AURA=1" ]
92   }
93   if (use_pango) {
94     defines += [ "USE_PANGO=1" ]
95   }
96   if (use_cairo) {
97     defines += [ "USE_CAIRO=1" ]
98   }
99   if (use_clipboard_aurax11) {
100     defines += [ "USE_CLIPBOARD_AURAX11=1" ]
101   }
102   if (use_default_render_theme) {
103     defines += [ "USE_DEFAULT_RENDER_THEME=1" ]
104   }
105   if (use_glib) {
106     defines += [ "USE_GLIB=1" ]
107   }
108   if (use_openssl) {
109     defines += [ "USE_OPENSSL=1" ]
110     if (use_openssl_certs) {
111       defines += [ "USE_OPENSSL_CERTS=1" ]
112     }
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" ]
118   }
119   if (use_ozone) {
120     defines += [ "USE_OZONE=1" ]
121   }
122   if (use_x11) {
123     defines += [ "USE_X11=1" ]
124   }
125   if (use_allocator != "tcmalloc") {
126     defines += [ "NO_TCMALLOC" ]
127   }
128   if (is_asan) {
129     defines += [
130       "ADDRESS_SANITIZER",
131       "MEMORY_TOOL_REPLACES_ALLOCATOR",
132       "MEMORY_SANITIZER_INITIAL_SIZE",
133     ]
134   }
135   if (enable_webrtc) {
136     defines += [ "ENABLE_WEBRTC=1" ]
137   }
138   if (disable_ftp_support) {
139     defines += [ "DISABLE_FTP_SUPPORT=1" ]
140   }
141   if (!enable_nacl) {
142     defines += [ "DISABLE_NACL" ]
143   }
144   if (enable_extensions) {
145     defines += [ "ENABLE_EXTENSIONS=1" ]
146   }
147   if (enable_configuration_policy) {
148     defines += [ "ENABLE_CONFIGURATION_POLICY" ]
149   }
150   if (enable_task_manager) {
151     defines += [ "ENABLE_TASK_MANAGER=1" ]
152   }
153   if (enable_themes) {
154     defines += [ "ENABLE_THEMES=1" ]
155   }
156   if (enable_captive_portal_detection) {
157     defines += [ "ENABLE_CAPTIVE_PORTAL_DETECTION=1" ]
158   }
159   if (enable_session_service) {
160     defines += [ "ENABLE_SESSION_SERVICE=1" ]
161   }
162   if (enable_rlz) {
163     defines += [ "ENABLE_RLZ" ]
164   }
165   if (enable_plugin_installation) {
166     defines += [ "ENABLE_PLUGIN_INSTALLATION=1" ]
167   }
168   if (enable_app_list) {
169     defines += [ "ENABLE_APP_LIST=1" ]
170   }
171   if (enable_settings_app) {
172     defines += [ "ENABLE_SETTINGS_APP=1" ]
173   }
174   if (enable_managed_users) {
175     defines += [ "ENABLE_MANAGED_USERS=1" ]
176   }
177   if (enable_service_discovery) {
178     defines += [ "ENABLE_SERVICE_DISCOVERY=1" ]
179   }
180   if (enable_autofill_dialog) {
181     defines += [ "ENABLE_AUTOFILL_DIALOG=1" ]
182   }
183   if (enable_wifi_bootstrapping) {
184     defines += [ "ENABLE_WIFI_BOOTSTRAPPING=1" ]
185   }
186   if (enable_image_loader_extension) {
187     defines += [ "IMAGE_LOADER_EXTENSION=1" ]
188   }
189   if (enable_remoting) {
190     defines += [ "ENABLE_REMOTING=1" ]
191   }
192   if (enable_google_now) {
193     defines += [ "ENABLE_GOOGLE_NOW=1" ]
194   }
195   if (enable_one_click_signin) {
196     defines += [ "ENABLE_ONE_CLICK_SIGNIN" ]
197   }
198   if (use_athena) {
199     defines += [ "USE_ATHENA=1" ]
200   }
201   if (enable_hidpi) {
202     defines += [ "ENABLE_HIDPI=1" ]
203   }
204   if (proprietary_codecs) {
205     defines += [ "USE_PROPRIETARY_CODECS" ]
206   }
209 # Debug/release ----------------------------------------------------------------
211 config("debug") {
212   defines = [
213     "_DEBUG",
214     "DYNAMIC_ANNOTATIONS_ENABLED=1",
215     "WTF_USE_DYNAMIC_ANNOTATIONS=1",
216   ]
218   if (is_win) {
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" ]
223     }
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" ]
230   }
233 config("release") {
234   defines = [
235     "NDEBUG",
236   ]
239 # Default libraries ------------------------------------------------------------
241 # This config defines the default libraries applied to all targets.
242 config("default_libs") {
243   if (is_win) {
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.
247     libs = [
248       "advapi32.lib",
249       "comdlg32.lib",
250       "dbghelp.lib",
251       "delayimp.lib",
252       "dnsapi.lib",
253       "gdi32.lib",
254       "kernel32.lib",
255       "msimg32.lib",
256       "odbc32.lib",
257       "odbccp32.lib",
258       "ole32.lib",
259       "oleaut32.lib",
260       "psapi.lib",
261       "shell32.lib",
262       "shlwapi.lib",
263       "user32.lib",
264       "usp10.lib",
265       "uuid.lib",
266       "version.lib",
267       "wininet.lib",
268       "winmm.lib",
269       "winspool.lib",
270       "ws2_32.lib",
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.
275     ]
276   } else if (is_android) {
277     # Android uses -nostdlib so we need to add even libc here.
278     libs = [
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)',
285       "c",
286       "dl",
287       "m"
288     ]
289   } else if (is_mac) {
290     libs = [
291       "AppKit.framework",
292       "ApplicationServices.framework",
293       "Carbon.framework",
294       "CoreFoundation.framework",
295       "Foundation.framework",
296       "IOKit.framework",
297       "Security.framework",
298     ]
299   } else if (is_ios) {
300     libs = [
301       "CoreFoundation.framework",
302       "CoreGraphics.framework",
303       "CoreText.framework",
304       "Foundation.framework",
305       "UIKit.framework",
306     ]
307   } else if (is_linux) {
308     libs = [
309       "dl",
310     ]
311   }