Revert of Reland https://codereview.chromium.org/298333007/: Enable mac_strip_release...
[chromium-blink-merge.git] / chrome / BUILD.gn
blobdc1444eb4e9a7347d28519635083468dbb2d734f
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       "//content/app/resources",
116       "//crypto",
117       "//net:net_resources",
118       "//third_party/wtl",
119       "//ui/views",
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     # TODO(brettW) this should have more reduced visibility, but chrome/browser
216     # currently depends on this.
217     #visibility = ":*"
218     source = "version.h.in"
219     # TODO(brettw) this should move to $target_gen_dir/version.h and
220     # source files including it should reference it via "chrome/version.h"
221     output = "$root_gen_dir/version.h"
222   }
225 # GYP version: chrome/chrome_resources.gyp:chrome_resources
226 group("resources") {
227   deps = [
228     # Note: GYP lists some dependencies in addition to these actions. However,
229     # these are just dependencies for the actions themselves, which our actions
230     # list individually when needed.
231     "//chrome/browser:resources",
232     "//chrome/common:resources",
233     "//chrome/renderer:resources",
234   ]
236   if (enable_extensions) {
237     deps += [ "//chrome/common:extensions_api_resources" ]
238   }
241 # GYP version: chrome/chrome_resources.gyp:chrome_extra_resources
242 group("extra_resources") {
243   deps = [
244     "//chrome/browser/resources:invalidations_resources",
245     "//chrome/browser/resources:memory_internals_resources",
246     "//chrome/browser/resources:net_internals_resources",
247     "//chrome/browser/resources:password_manager_internals_resources",
248     "//chrome/browser/resources:signin_internals_resources",
249     "//chrome/browser/resources:sync_internals_resources",
250     "//chrome/browser/resources:translate_internals_resources",
251   ]
252   if (!is_ios) {
253     deps += [
254       "//chrome/browser/resources:component_extension_resources",
255       "//chrome/browser/resources:options_resources",
256     ]
257   }
259   if (enable_chromevox_next) {
260     deps += [
261       #'browser/resources/chromeos/chromevox2/chromevox.gyp:chromevox2',  TODO(GYP)
262     ]
263   } else {
264     deps += [
265       #'browser/resources/chromeos/chromevox/chromevox.gyp:chromevox',  TODO(GYP)
266     ]
267   }
269   if (enable_extensions) {
270     deps += [
271       "//chrome/browser/resources:quota_internals_resources",
272       "//chrome/browser/resources:sync_file_system_internals_resources",
273     ]
274   }
277 # GYP version: chrome/chrome_resources.gyp:chrome_strings
278 group("strings") {
279   deps = [
280     "//chrome/app:chromium_strings",
281     "//chrome/app:generated_resources",
282     "//chrome/app:google_chrome_strings",
283     "//chrome/app/resources:locale_settings",
284   ]