Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / build / config / BUILD.gn
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.
4
5 import("//build/config/ui.gni")
6
7 declare_args() {
8   # When set, turns off the (normally-on) iterator debugging and related stuff
9   # that is normall turned on for Debug builds. These are generally useful for
10   # catching bugs but in some cases may cause conflicts or excessive slowness.
11   disable_iterator_debugging = false
12 }
13
14 # TODO(brettw) Most of these should be removed. Instead of global feature
15 # flags, we should have more modular flags that apply only to a target and its
16 # dependents. For example, depending on the "x11" meta-target should define
17 # USE_X11 for all dependents so that everything that could use X11 gets the
18 # define, but anything that doesn't depend on X11 doesn't see it.
19 #
20 # For now we define these globally to match the current GYP build.
21 config("feature_flags") {
22   # TODO(brettw) most of these need to be parameterized.
23   defines = [
24       "CHROMIUM_BUILD",
25       "USE_LIBJPEG_TURBO=1",
26       "ENABLE_ONE_CLICK_SIGNIN",
27       "ENABLE_REMOTING=1",
28       "ENABLE_WEBRTC=1",
29       "ENABLE_CONFIGURATION_POLICY",
30       "ENABLE_INPUT_SPEECH",
31       "ENABLE_NOTIFICATIONS",
32       "ENABLE_EGLIMAGE=1",
33       "ENABLE_TASK_MANAGER=1",
34       "ENABLE_EXTENSIONS=1",
35       "ENABLE_PLUGIN_INSTALLATION=1",
36       "ENABLE_PLUGINS=1",
37       "ENABLE_SESSION_SERVICE=1",
38       "ENABLE_THEMES=1",
39       "ENABLE_AUTOFILL_DIALOG=1",
40       "ENABLE_BACKGROUND=1",
41       "ENABLE_AUTOMATION=1",
42       "ENABLE_GOOGLE_NOW=1",
43       "ENABLE_PRINTING=1",
44       "ENABLE_CAPTIVE_PORTAL_DETECTION=1",
45       "ENABLE_APP_LIST=1",
46       "ENABLE_MESSAGE_CENTER=1",
47       "ENABLE_SETTINGS_APP=1",
48       "ENABLE_MANAGED_USERS=1",
49   ]
50
51   if (toolkit_views) {
52     defines += [ "TOOLKIT_VIEWS=1" ]
53   }
54   if (use_ash) {
55     defines += [ "USE_ASH=1" ]
56   }
57   if (use_aura) {
58     defines += [ "USE_AURA=1" ]
59   }
60   if (use_glib) {
61     defines += [ "USE_GLIB=1" ]
62   }
63   if (use_ozone) {
64     defines += [ "USE_OZONE=1" ]
65   }
66   if (use_x11) {
67     defines += [ "USE_X11=1" ]
68   }
69 }
70
71 # Debug/release ----------------------------------------------------------------
72
73 config("debug") {
74   defines = [
75     "_DEBUG",
76     "DYNAMIC_ANNOTATIONS_ENABLED=1",
77     "WTF_USE_DYNAMIC_ANNOTATIONS=1",
78   ]
79
80   if (is_win) {
81     if (disable_iterator_debugging) {
82       # Iterator debugging is enabled by the compiler on debug builds, and we
83       # have to tell it to turn it off.
84       defines += [ "_HAS_ITERATOR_DEBUGGING=0" ]
85     }
86   } else if (is_linux && !is_android && cpu_arch == "x64" &&
87              !disable_iterator_debugging) {
88     # Enable libstdc++ debugging facilities to help catch problems early, see
89     # http://crbug.com/65151 .
90     # TODO(phajdan.jr): Should we enable this for all of POSIX?
91     defines += [ "_GLIBCXX_DEBUG=1" ]
92   }
93 }
94
95 config("release") {
96 }
97
98 # Default libraries ------------------------------------------------------------
99
100 # This config defines the default libraries applied to all targets.
101 config("default_libs") {
102   if (is_win) {
103     # TODO(brettw) this list of defaults should probably be smaller, and
104     # instead the targets that use the less common ones (e.g. wininet or
105     # winspool) should include those explicitly.
106     libs = [
107       "advapi32.lib",
108       "comdlg32.lib",
109       "dbghelp.lib",
110       "delayimp.lib",
111       "dnsapi.lib",
112       "gdi32.lib",
113       "kernel32.lib",
114       "msimg32.lib",
115       "odbc32.lib",
116       "odbccp32.lib",
117       "ole32.lib",
118       "oleaut32.lib",
119       "psapi.lib",
120       "shell32.lib",
121       "shlwapi.lib",
122       "user32.lib",
123       "usp10.lib",
124       "uuid.lib",
125       "version.lib",
126       "wininet.lib",
127       "winmm.lib",
128       "winspool.lib",
129       "ws2_32.lib",
130     ]
131   } else if (is_android) {
132     # Android uses -nostdlib so we need to add even libc here.
133     libs = [
134       # TODO(brettw) write a version of this, hopefully we can express this
135       # without forking out to GCC just to get the library name. The android
136       # toolchain directory should probably be extracted into a .gni file that
137       # this file and the android toolchain .gn file can share.
138       #   # Manually link the libgcc.a that the cross compiler uses.
139       #   '<!(<(android_toolchain)/*-gcc -print-libgcc-file-name)',
140       "c",
141       "dl",
142       "m"
143     ]
144   } else if (is_mac) {
145     libs = [
146       "AppKit.framework",
147       "ApplicationServices.framework",
148       "Carbon.framework",
149       "CoreFoundation.framework",
150       "Foundation.framework",
151       "IOKit.framework",
152       "Security.framework",
153     ]
154   } else if (is_ios) {
155     libs = [
156       "CoreFoundation.framework",
157       "CoreGraphics.framework",
158       "CoreText.framework",
159       "Foundation.framework",
160       "UIKit.framework",
161     ]
162   } else if (is_linux) {
163     libs = [
164       "dl",
165     ]
166   }
167 }