Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(243)

Side by Side Diff: chrome/installer/util/BUILD.gn

Issue 1534903002: Split GN installer_util into one that has no strings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comment Created 4 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/chrome_watcher/BUILD.gn ('k') | win8/delegate_execute/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 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 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import("//build/config/chrome_build.gni") 5 import("//build/config/chrome_build.gni")
6 import("//testing/test.gni") 6 import("//testing/test.gni")
7 7
8 static_library("util") { 8 # Generally you should depend on this target, see below for discussion.
9 group("util") {
10 public_deps = [
11 ":with_no_strings_some_things_wont_work",
12 ]
13 if (is_win) {
14 public_deps += [ ":strings" ]
15 }
16 }
17
18 # chrome/installer/util has generated strings on Windows. These appear as
19 # Windows resources and are fairly large (~200KB). They are generated by the
20 # ":generate_strings" target and compiled by the ":strings" target.
21 #
22 # Some code, like the Windows chrome.exe (the small bootstrap binary, not
23 # all of chrome.dll) code uses installer_util functions without calling any
24 # functions that use the strings. And historically in the GYP build the strings
25 # resource had to be manually linked, so the strings never ended up being in
26 # chrome.exe and everything was fine.
27 #
28 # However, this is obviously a fragile and confusing situation. If you depend
29 # on this target rather than going through the ":util" version that links the
30 # strings above, anything that uses localized strings won't work. There is
31 # no definition of what works and doesn't work, and this may also change over
32 # time. As an example at the time of this writing, chrome.exe calls
33 # BrowserDistribution::GetRegistryPath. This function doesn't use any strings,
34 # but lots of other functions in BrowserDistribution do use localized strings.
35 #
36 # Ideally, this should be cleaved in two parts: the main "installer util" and
37 # some kind of mini installer util that just contains the functions needed by
38 # chrome.exe and any other clients that don't need the strings.
39 static_library("with_no_strings_some_things_wont_work") {
9 deps = [ 40 deps = [
10 "//base", 41 "//base",
11 "//chrome:strings", 42 "//chrome:strings",
12 "//chrome/common:constants", 43 "//chrome/common:constants",
13 "//components/variations", 44 "//components/variations",
14 "//content/public/common:result_codes", 45 "//content/public/common:result_codes",
15 ] 46 ]
16 47
17 # The constants target checks the Chrome distribution from this target. Both 48 # The constants target checks the Chrome distribution from this target. Both
18 # targets have to be linked together in practice. 49 # targets have to be linked together in practice.
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 "self_cleaning_temp_dir.cc", 90 "self_cleaning_temp_dir.cc",
60 "self_cleaning_temp_dir.h", 91 "self_cleaning_temp_dir.h",
61 "shell_util.cc", 92 "shell_util.cc",
62 "shell_util.h", 93 "shell_util.h",
63 "uninstall_metrics.cc", 94 "uninstall_metrics.cc",
64 "uninstall_metrics.h", 95 "uninstall_metrics.h",
65 "user_experiment.cc", 96 "user_experiment.cc",
66 "user_experiment.h", 97 "user_experiment.h",
67 ] 98 ]
68 99
69 public_deps = [
70 ":strings",
71 ]
72 deps += [ 100 deps += [
101 # Need to depend on the generated strings target since files here
102 # depend on the generated header, but only depend on the ":strings"
103 # target (which actually compiles and causes the generated code to be
104 # linked) from the ":util" target.
105 ":generate_strings",
73 "//base/third_party/dynamic_annotations", 106 "//base/third_party/dynamic_annotations",
74 "//components/metrics", 107 "//components/metrics",
75 "//courgette:courgette_lib", 108 "//courgette:courgette_lib",
76 "//crypto", 109 "//crypto",
77 "//third_party/bspatch", 110 "//third_party/bspatch",
78 "//third_party/icu", 111 "//third_party/icu",
79 "//third_party/lzma_sdk", 112 "//third_party/lzma_sdk",
80 ] 113 ]
81 114
82 configs += [ 115 configs += [
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 sources = [ 213 sources = [
181 "master_preferences.cc", 214 "master_preferences.cc",
182 "master_preferences.h", 215 "master_preferences.h",
183 "master_preferences_constants.cc", 216 "master_preferences_constants.cc",
184 "master_preferences_constants.h", 217 "master_preferences_constants.h",
185 ] 218 ]
186 } 219 }
187 } 220 }
188 221
189 action("generate_strings") { 222 action("generate_strings") {
190 visibility = [ ":strings" ] 223 visibility = [
224 ":strings",
225 ":with_no_strings_some_things_wont_work",
226 ]
191 script = "prebuild/create_string_rc.py" 227 script = "prebuild/create_string_rc.py"
192 228
193 if (is_chrome_branded) { 229 if (is_chrome_branded) {
194 grdfile = "//chrome/app/google_chrome_strings.grd" 230 grdfile = "//chrome/app/google_chrome_strings.grd"
195 } else { 231 } else {
196 grdfile = "//chrome/app/chromium_strings.grd" 232 grdfile = "//chrome/app/chromium_strings.grd"
197 } 233 }
198 234
199 inputs = [ 235 inputs = [
200 grdfile, 236 grdfile,
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 "//chrome/installer/test:alternate_version_generator_lib", 320 "//chrome/installer/test:alternate_version_generator_lib",
285 "//components/variations", 321 "//components/variations",
286 "//content/public/common", 322 "//content/public/common",
287 "//testing/gmock", 323 "//testing/gmock",
288 "//testing/gtest", 324 "//testing/gtest",
289 ] 325 ]
290 326
291 # TODO(GYP) manifest: $(ProjectDir)\\installer\\mini_installer\\mini_install er.exe.manifest 327 # TODO(GYP) manifest: $(ProjectDir)\\installer\\mini_installer\\mini_install er.exe.manifest
292 } 328 }
293 } # is_win 329 } # is_win
OLDNEW
« no previous file with comments | « chrome/chrome_watcher/BUILD.gn ('k') | win8/delegate_execute/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698