OLD | NEW |
1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 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/compiler/compiler.gni") |
5 import("//build/config/features.gni") | 6 import("//build/config/features.gni") |
6 import("//build/config/ui.gni") | 7 import("//build/config/ui.gni") |
| 8 import("//build/config/win/visual_studio_version.gni") |
7 import("//build_overrides/v8.gni") | 9 import("//build_overrides/v8.gni") |
8 import("//chrome/test/mini_installer/mini_installer_test.gni") | 10 import("//chrome/test/mini_installer/mini_installer_test.gni") |
9 import("//chrome/version.gni") | 11 import("//chrome/version.gni") |
10 import("//third_party/icu/config.gni") | 12 import("//third_party/icu/config.gni") |
11 import("//ui/base/ui_features.gni") | 13 import("//ui/base/ui_features.gni") |
12 | 14 |
13 config("mini_installer_compiler_flags") { | 15 config("mini_installer_compiler_flags") { |
14 # Disable buffer security checking. | 16 # Disable buffer security checking. |
15 cflags = [ "/GS-" ] | 17 cflags = [ "/GS-" ] |
16 } | 18 } |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 | 67 |
66 public_deps = [ | 68 public_deps = [ |
67 ":lib", | 69 ":lib", |
68 ] | 70 ] |
69 deps = [ | 71 deps = [ |
70 "//base", | 72 "//base", |
71 "//testing/gtest", | 73 "//testing/gtest", |
72 ] | 74 ] |
73 } | 75 } |
74 | 76 |
75 packed_files_rc_file = "$target_gen_dir/packed_files.rc" | |
76 | |
77 # The runtime deps are used to tell create_installer_archive what component | 77 # The runtime deps are used to tell create_installer_archive what component |
78 # DLLs need to be packaged in a component build. | 78 # DLLs need to be packaged in a component build. |
79 chrome_runtime_deps = "$root_gen_dir/chrome_component.runtime_deps" | 79 chrome_runtime_deps = "$root_gen_dir/chrome_component.runtime_deps" |
80 setup_runtime_deps = "$root_gen_dir/setup.runtime_deps" | 80 setup_runtime_deps = "$root_gen_dir/setup.runtime_deps" |
81 | 81 |
82 group("chrome_runtime_deps") { | 82 group("chrome_runtime_deps") { |
83 write_runtime_deps = chrome_runtime_deps | 83 write_runtime_deps = chrome_runtime_deps |
84 data_deps = [ | 84 data_deps = [ |
85 "//chrome", | 85 "//chrome", |
86 ] | 86 ] |
87 } | 87 } |
88 | 88 |
89 group("setup_runtime_deps") { | 89 group("setup_runtime_deps") { |
90 write_runtime_deps = setup_runtime_deps | 90 write_runtime_deps = setup_runtime_deps |
91 data_deps = [ | 91 data_deps = [ |
92 "//chrome/installer/setup", | 92 "//chrome/installer/setup", |
93 ] | 93 ] |
94 } | 94 } |
95 | 95 |
96 action("archive") { | 96 # Generates a mini installer. |
97 script = "//chrome/tools/build/win/create_installer_archive.py" | 97 # |
| 98 # out_dir (required) |
| 99 # The output directory out_dir where the mini_installer image should be |
| 100 # written. |
| 101 # |
| 102 # deps (required) |
| 103 # Normal meaning. |
| 104 template("generate_mini_installer") { |
| 105 custom_deps = invoker.deps |
| 106 output_dir = invoker.out_dir |
98 | 107 |
99 release_file = "chrome.release" | 108 packed_files_rc_file = "$target_gen_dir/$target_name/packed_files.rc" |
| 109 archive_name = target_name + "_archive" |
| 110 staging_dir = "$target_gen_dir/$target_name" |
100 | 111 |
101 inputs = [ | 112 action(archive_name) { |
102 "$root_out_dir/chrome.exe", | 113 script = "//chrome/tools/build/win/create_installer_archive.py" |
103 "$root_out_dir/chrome.dll", | |
104 "$root_out_dir/locales/en-US.pak", | |
105 "$root_out_dir/setup.exe", | |
106 release_file, | |
107 ] | |
108 | 114 |
109 outputs = [ | 115 release_file = "chrome.release" |
110 # See also chrome.packed.7z conditionally added below. | |
111 "$root_out_dir/chrome.7z", | |
112 "$root_out_dir/setup.ex_", | |
113 packed_files_rc_file, | |
114 ] | |
115 args = [ | |
116 "--build_dir", | |
117 rebase_path(root_out_dir, root_build_dir), | |
118 "--staging_dir", | |
119 rebase_path(root_gen_dir, root_build_dir), | |
120 "--input_file", | |
121 rebase_path(release_file, root_build_dir), | |
122 "--resource_file_path", | |
123 rebase_path(packed_files_rc_file, root_build_dir), | |
124 "--target_arch=$current_cpu", | |
125 "--distribution=_google_chrome", | |
126 "--chrome_runtime_deps", | |
127 rebase_path(chrome_runtime_deps, root_build_dir), | |
128 "--setup_runtime_deps", | |
129 rebase_path(setup_runtime_deps, root_build_dir), | |
130 | 116 |
131 # Optional arguments to generate diff installer. | 117 inputs = [ |
132 #'--last_chrome_installer=C:/Temp/base', | 118 "$output_dir/chrome.dll", |
133 #'--setup_exe_format=DIFF', | 119 "$root_out_dir/chrome.exe", |
134 #'--diff_algorithm=COURGETTE', | 120 "$root_out_dir/locales/en-US.pak", |
| 121 "$root_out_dir/setup.exe", |
| 122 release_file, |
| 123 ] |
135 | 124 |
136 # Optional argument for verbose archiving output. | 125 outputs = [ |
137 #'--verbose', | 126 # See also chrome.packed.7z conditionally added below. |
138 ] | 127 "$output_dir/chrome.7z", |
| 128 "$output_dir/setup.ex_", |
| 129 packed_files_rc_file, |
| 130 ] |
| 131 args = [ |
| 132 "--build_dir", |
| 133 rebase_path(root_out_dir, root_build_dir), |
| 134 "--staging_dir", |
| 135 rebase_path(staging_dir, root_build_dir), |
| 136 "--input_file", |
| 137 rebase_path(release_file, root_build_dir), |
| 138 "--resource_file_path", |
| 139 rebase_path(packed_files_rc_file, root_build_dir), |
| 140 "--target_arch=$current_cpu", |
| 141 "--distribution=_google_chrome", |
| 142 "--output_dir", |
| 143 rebase_path(output_dir, root_build_dir), |
| 144 "--chrome_runtime_deps", |
| 145 rebase_path(chrome_runtime_deps, root_build_dir), |
| 146 "--setup_runtime_deps", |
| 147 rebase_path(setup_runtime_deps, root_build_dir), |
139 | 148 |
140 deps = [ | 149 # Optional arguments to generate diff installer. |
141 ":chrome_runtime_deps", | 150 #'--last_chrome_installer=C:/Temp/base', |
142 ":setup_runtime_deps", | 151 #'--setup_exe_format=DIFF', |
143 "//chrome", | 152 #'--diff_algorithm=COURGETTE', |
144 "//chrome:main_dll", | |
145 "//chrome/browser/extensions/default_extensions", | |
146 "//chrome/installer/setup", | |
147 "//third_party/icu:icudata", | |
148 ] | |
149 | 153 |
150 if (enable_hidpi) { | 154 # Optional argument for verbose archiving output. |
151 args += [ "--enable_hidpi=1" ] | 155 #'--verbose', |
152 } | 156 ] |
153 if (is_component_build) { | 157 |
154 args += [ "--component_build=1" ] | 158 deps = custom_deps + [ |
155 } else { | 159 ":chrome_runtime_deps", |
156 outputs += [ "$root_out_dir/chrome.packed.7z" ] | 160 ":setup_runtime_deps", |
| 161 "//chrome", |
| 162 "//chrome/browser/extensions/default_extensions", |
| 163 "//chrome/installer/setup", |
| 164 "//third_party/icu:icudata", |
| 165 ] |
| 166 |
| 167 if (enable_hidpi) { |
| 168 args += [ "--enable_hidpi=1" ] |
| 169 } |
| 170 if (is_component_build) { |
| 171 args += [ "--component_build=1" ] |
| 172 } else { |
| 173 outputs += [ "$output_dir/chrome.packed.7z" ] |
| 174 } |
| 175 |
| 176 if (enable_nacl) { |
| 177 inputs += [ "$root_out_dir/nacl_irt_x86_64.nexe" ] |
| 178 deps += [ "//ppapi/native_client:irt" ] |
| 179 if (current_cpu == "x86") { |
| 180 inputs += [ |
| 181 "$root_out_dir/nacl64.exe", |
| 182 "$root_out_dir/nacl_irt_x86_32.nexe", |
| 183 ] |
| 184 deps += [ "//components/nacl/broker:nacl64" ] |
| 185 } |
| 186 } |
| 187 |
| 188 if (icu_use_data_file) { |
| 189 inputs += [ "$root_out_dir/icudtl.dat" ] |
| 190 } else { |
| 191 inputs += [ "$root_out_dir/icudt.dll" ] |
| 192 } |
| 193 |
| 194 if (v8_use_external_startup_data) { |
| 195 inputs += [ |
| 196 "$root_out_dir/natives_blob.bin", |
| 197 "$root_out_dir/snapshot_blob.bin", |
| 198 ] |
| 199 deps += [ "//v8" ] |
| 200 } |
| 201 |
| 202 depfile = "$target_gen_dir/archive.d" |
| 203 args += [ |
| 204 "--depfile", |
| 205 rebase_path(depfile, root_build_dir), |
| 206 ] |
157 } | 207 } |
158 | 208 |
159 if (enable_nacl) { | 209 executable(target_name) { |
160 inputs += [ "$root_out_dir/nacl_irt_x86_64.nexe" ] | 210 output_name = "mini_installer" |
161 deps += [ "//ppapi/native_client:irt" ] | 211 sources = [ |
162 if (current_cpu == "x86") { | 212 "mini_installer.cc", |
163 inputs += [ | 213 packed_files_rc_file, |
164 "$root_out_dir/nacl64.exe", | 214 ] |
165 "$root_out_dir/nacl_irt_x86_32.nexe", | 215 |
166 ] | 216 # This target is special so we manually override most linker flags and |
167 deps += [ "//components/nacl/broker:nacl64" ] | 217 # specify our own to keep the size down. Also make sure that we don't use |
168 } | 218 # WPO as it's not supported by the mini installer. |
| 219 configs -= [ |
| 220 "//build/config/compiler:default_optimization", |
| 221 "//build/config:executable_config", |
| 222 "//build/config/win:console", |
| 223 ] |
| 224 configs += [ |
| 225 ":mini_installer_compiler_flags", |
| 226 "//build/config/compiler:optimize_no_wpo", |
| 227 "//build/config/win:sdk_link", |
| 228 "//build/config/win:windowed", |
| 229 ] |
| 230 |
| 231 ldflags = [ |
| 232 "/ENTRY:MainEntryPoint", |
| 233 "/FIXED:NO", |
| 234 "/ignore:4199", |
| 235 "/NXCOMPAT", |
| 236 ] |
| 237 |
| 238 libs = [ "setupapi.lib" ] |
| 239 |
| 240 deps = [ |
| 241 ":$archive_name", |
| 242 ":lib", |
| 243 ":version", |
| 244 "//build/config/sanitizers:deps", |
| 245 "//build/win:default_exe_manifest", |
| 246 ] |
169 } | 247 } |
| 248 } |
170 | 249 |
171 if (icu_use_data_file) { | 250 generate_mini_installer("mini_installer") { |
172 inputs += [ "$root_out_dir/icudtl.dat" ] | 251 out_dir = root_out_dir |
173 } else { | 252 deps = [ |
174 inputs += [ "$root_out_dir/icudt.dll" ] | 253 "//chrome:main_dll", |
175 } | |
176 | |
177 if (v8_use_external_startup_data) { | |
178 inputs += [ | |
179 "$root_out_dir/natives_blob.bin", | |
180 "$root_out_dir/snapshot_blob.bin", | |
181 ] | |
182 deps += [ "//v8" ] | |
183 } | |
184 | |
185 depfile = "$target_gen_dir/archive.d" | |
186 args += [ | |
187 "--depfile", | |
188 rebase_path(depfile, root_build_dir), | |
189 ] | 254 ] |
190 } | 255 } |
191 | 256 |
192 executable("mini_installer") { | 257 if (syzygy_optimize) { |
193 sources = [ | 258 generate_mini_installer("mini_installer_syzygy") { |
194 "mini_installer.cc", | 259 out_dir = "$root_out_dir/syzygy/" |
195 packed_files_rc_file, | 260 deps = [ |
196 ] | 261 "//chrome/tools/build/win/syzygy:chrome_dll_syzygy", |
197 | 262 ] |
198 # This target is special so we manually override most linker flags and | |
199 # specify our own to keep the size down. Also make sure that we don't use | |
200 # WPO as it's not supported by the mini installer. | |
201 configs -= [ | |
202 "//build/config/compiler:default_optimization", | |
203 "//build/config:executable_config", | |
204 "//build/config/win:console", | |
205 ] | |
206 configs += [ | |
207 ":mini_installer_compiler_flags", | |
208 "//build/config/win:sdk_link", | |
209 "//build/config/win:windowed", | |
210 ] | |
211 if (!is_debug) { | |
212 configs += [ "//build/config/compiler:optimize_no_wpo" ] | |
213 } else { | |
214 configs += [ "//build/config/compiler:no_optimize" ] | |
215 } | 263 } |
216 | |
217 ldflags = [ | |
218 "/ENTRY:MainEntryPoint", | |
219 "/FIXED:NO", | |
220 "/ignore:4199", | |
221 "/NXCOMPAT", | |
222 ] | |
223 | |
224 libs = [ "setupapi.lib" ] | |
225 | |
226 deps = [ | |
227 ":archive", | |
228 ":lib", | |
229 ":version", | |
230 "//build/config/sanitizers:deps", | |
231 "//build/win:default_exe_manifest", | |
232 ] | |
233 } | 264 } |
234 | 265 |
235 # next_version_mini_installer.exe can't be generated in an x86 Debug component | 266 # next_version_mini_installer.exe can't be generated in an x86 Debug component |
236 # build because it requires too much memory. | 267 # build because it requires too much memory. |
237 if (!(is_component_build && is_debug && target_cpu == "x86")) { | 268 if (!(is_component_build && is_debug && target_cpu == "x86")) { |
238 action("next_version_mini_installer") { | 269 action("next_version_mini_installer") { |
239 script = "generate_next_version_mini_installer.py" | 270 script = "generate_next_version_mini_installer.py" |
240 testonly = true | 271 testonly = true |
241 inputs = [ | 272 inputs = [ |
242 "$root_out_dir/alternate_version_generator.exe", | 273 "$root_out_dir/alternate_version_generator.exe", |
243 "$root_out_dir/mini_installer.exe", | 274 "$root_out_dir/mini_installer.exe", |
244 ] | 275 ] |
245 outputs = [ | 276 outputs = [ |
246 "$root_out_dir/$target_name.exe", | 277 "$root_out_dir/$target_name.exe", |
247 ] | 278 ] |
248 args = [ | 279 args = [ |
249 "--out", | 280 "--out", |
250 "$target_name.exe", | 281 "$target_name.exe", |
251 ] | 282 ] |
252 deps = [ | 283 deps = [ |
253 ":mini_installer", | 284 ":mini_installer", |
254 "//chrome/installer/test:alternate_version_generator", | 285 "//chrome/installer/test:alternate_version_generator", |
255 ] | 286 ] |
256 } | 287 } |
257 } | 288 } |
OLD | NEW |