Revert of Create a new AccountTrackerService (patchset #8 of https://codereview.chrom...
[chromium-blink-merge.git] / chrome / BUILD.gn
blob6a687409030544616f99c8ad58c6c489020fc64a
1 # Copyright 2014 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/features.gni")
6 import("//build/config/ui.gni")
7 import("//chrome/version.gni")
9 # TODO(GYP) for Windows need to the the reorder-imports step which probably
10 # means adding another target and renaming this to chrome_initial like in GYP.
11 #executable("chrome") {  # TODO(GYP) enable once this links.
12 source_set("chrome") {
13   # Because the sources list varies so significantly per-platform, generally
14   # each platform lists its own files rather than relying on filtering or
15   # removing unused files.
16   sources = [
17     "app/chrome_exe_resource.h",
18   ]
19   deps = []
21   # TODO(GYP) mac_bundle_resources, xcode_settings
23   # TODO(GYP) order_profiling, order_text_section
25   if (is_win) {
26     sources += [
27       "app/chrome_exe_main_win.cc",
28       "app/client_util.cc",
29       "app/client_util.h",
30       "app/signature_validator_win.cc",
31       "app/signature_validator_win.h",
32       "//content/app/startup_helper_win.cc",
33     ]
34     deps += [ "//ui/gfx" ]
35   } else if (use_aura) {
36     # Non-Windows aura entrypoint.
37     sources += [ "app/chrome_exe_main_aura.cc" ]
38   }
40   if (is_linux) {
41     # TODO(GYP) manpage action
43     sources += [
44       "app/chrome_dll_resource.h",
45       "app/chrome_main.cc",
46       "app/chrome_main_delegate.cc",
47       "app/chrome_main_delegate.h",
48     ]
50     deps += [
51       # On Linux, link the dependencies (libraries) that make up actual
52       # Chromium functionality directly into the executable.
53       ":browser_dependencies",
54       ":child_dependencies",
56       "//base/allocator",
57       # Needed to use the master_preferences functions
58       "//chrome/installer/util",
59       "//content/app:both",
60     ]
62     # Needed for chrome_main.cc initialization of libraries.
63     configs += [ "//build/config/linux:pangocairo" ]
65     # TODO(GYP) ['profiling==0 and linux_disable_pie==0', {
66     #   'ldflags': [
67     #      '-pie',
68     #   ],
69     #}],
71     if (use_x11) {
72       configs += [
73         "//build/config/linux:x11",
74         "//build/config/linux:xext",
75       ]
76     }
77   }
79   if (is_mac) {
80     sources += [
81       "app/chrome_exe_main_mac.cc",
82     ]
83   }
84   # TODO(GYP) is_mac
88 shared_library("main_dll") {
89   configs += [ "//build/config/compiler:wexit_time_destructors" ]
91   deps = [
92     ":browser_dependencies",
93     "//base/allocator",
94   ]
95   if (is_win) {
96     output_name = "chrome"
98     sources = [
99       "app/chrome_command_ids.h",
100       "app/chrome_dll.rc",
101       "app/chrome_dll_resource.h",
102       "app/chrome_main.cc",
103       "app/chrome_main_delegate.cc",
104       "app/chrome_main_delegate.h",
105       "app/delay_load_hook_win.cc",
106       "app/delay_load_hook_win.h",
107       "//base/win/dllmain.cc",
108     ]
110     deps += [
111       # On Windows, link the dependencies (libraries) that make up actual
112       # Chromium functionality into this .dll.
113       #'chrome_version_resources',  TODO(GYP)
114       "//chrome/app/theme:chrome_unscaled_resources",
115       "//crypto",
116       "//net:resources",
117       "//third_party/wtl",
118       "//ui/views",
119       "//webkit/glue/resources",
120       #'<(DEPTH)/chrome_elf/chrome_elf.gyp:chrome_elf' ]  TODO(GYP)
121     ]
122     if (enable_configuration_policy) {
123       deps += [ "//components/policy" ]
124     }
125     if (cpu_arch == "x86") {
126       # Add a dependency to custom import library for user32 delay imports only
127       # in x86 builds.
128       #deps += [ 'chrome_user32_delay_imports' ]  TODO(GYP)
129     }
131     # TODO(GYP) incremental linking flags in debug builds
132     #'LinkIncremental': '<(msvs_large_module_debug_link_mode)',
134     # TODO(GYP) Lots of VCLinkerTool stuff on Windows.
136     # TODO(GYP) chrome_pgo_phase on Windows.
137   }
139   if (use_aura) {
140     deps += [ "//ui/compositor" ]
141   }
143   #TODO(GYP) add chrome_multiple_dll support
144   if (false) {  #chrome_multiple_dll) {
145     defines = [ "CHROME_MULTIPLE_DLL_BROWSER" ]
146     deps += [
147       "//content/app:browser",
148     ]
149   } else {
150     deps += [
151       ":child_dependencies",
152       "//content/app:both",
153     ]
154   }
156   if (cld_version == 0 || cld_version == 2) {
157     deps += [
158       "//third_party/cld_2",
159     ]
160   }
162   if (is_mac) {
163     #['OS=="mac" and component!="shared_library"', {  TODO(GYP)
164     #  'includes': [ 'chrome_dll_bundle.gypi' ],
165     #}],
167     # TODO(GYP) Lots of other stuff in the OS=="mac" block.
168   }
171 # GYP version: chromium_browser_dependencies variable in chrome.gyp
172 group("browser_dependencies") {
173   deps = [
174     "//chrome/browser",
175     "//chrome/common",
176     "//sync",
177   ]
178   if (!is_ios) {
179     deps += [
180       "//ppapi:ppapi_host",
181     ]
182   }
184   if (printing_mode != 0) {
185     deps += [ "//printing" ]
186     if (printing_mode == 1) {
187       deps += [ "//chrome/service" ]
188     }
189   }
192 # GYP version: chromium_child_dependencies variable in chrome.gyp
193 group("child_dependencies") {
194   deps = [
195     "//chrome/common",
196     "//sync",
197   ]
198   if (!is_ios) {
199     deps += [
200       "//chrome/browser/devtools",
201       "//chrome/plugin",
202       "//chrome/renderer",
203       "//chrome/utility",
204       "//content/gpu",
205       "//content/ppapi_plugin",
206       "//third_party/WebKit/public:blink_devtools_frontend_resources",
207     ]
208   }
211 if (is_win) {
212   # TODO(brettw) this duplicates "//chrome/common:version" which applies to
213   # Linux.
214   process_version("version_header") {
215     visibility = ":*"
216     source = "version.h.in"
217     # TODO(brettw) this should move to $target_gen_dir/version.h and
218     # source files including it should reference it via "chrome/version.h"
219     output = "$root_gen_dir/version.h"
220   }
223 # GYP version: chrome/chrome_resources.gyp:chrome_resources
224 group("resources") {
225   deps = [
226     # Note: GYP lists some dependencies in addition to these actions. However,
227     # these are just dependencies for the actions themselves, which our actions
228     # list individually when needed.
229     "//chrome/browser:resources",
230     "//chrome/common:resources",
231     "//chrome/renderer:resources",
232   ]
234   if (enable_extensions) {
235     deps += [ "//chrome/common:extensions_api_resources" ]
236   }
239 # GYP version: chrome/chrome_resources.gyp:chrome_extra_resources
240 group("extra_resources") {
241   deps = [
242     "//chrome/browser/resources:invalidations_resources",
243     "//chrome/browser/resources:memory_internals_resources",
244     "//chrome/browser/resources:net_internals_resources",
245     "//chrome/browser/resources:password_manager_internals_resources",
246     "//chrome/browser/resources:signin_internals_resources",
247     "//chrome/browser/resources:sync_internals_resources",
248     "//chrome/browser/resources:translate_internals_resources",
249   ]
250   if (!is_ios) {
251     deps += [
252       "//chrome/browser/resources:component_extension_resources",
253       "//chrome/browser/resources:options_resources",
254     ]
255   }
257   if (enable_chromevox_next) {
258     deps += [
259       #'browser/resources/chromeos/chromevox2/chromevox.gyp:chromevox2',  TODO(GYP)
260     ]
261   } else {
262     deps += [
263       #'browser/resources/chromeos/chromevox/chromevox.gyp:chromevox',  TODO(GYP)
264     ]
265   }
267   if (enable_extensions) {
268     deps += [
269       "//chrome/browser/resources:quota_internals_resources",
270       "//chrome/browser/resources:sync_file_system_internals_resources",
271     ]
272   }
275 # GYP version: chrome/chrome_resources.gyp:chrome_strings
276 group("strings") {
277   deps = [
278     "//chrome/app:chromium_strings",
279     "//chrome/app:generated_resources",
280     "//chrome/app:google_chrome_strings",
281     "//chrome/app/resources:locale_settings",
282   ]