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