| # Copyright 2019 The Chromium Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| import("//build/config/zip.gni") |
| import("//build/util/process_version.gni") |
| import("//chrome/process_version_rc_template.gni") |
| import("//chrome/updater/branding.gni") |
| import("//testing/libfuzzer/fuzzer_test.gni") |
| import("//testing/test.gni") |
| |
| # This target builds the updater executable, its installer, and unittests. |
| group("win") { |
| deps = [ |
| ":signing", |
| ":updater", |
| ":updater_zip", |
| "//chrome/updater/win/installer", |
| ] |
| } |
| |
| config("wrl_strict") { |
| # This definition is used in <wrl/module.h> to specify that only COM |
| # support is provided by WRL, and thus, avoid a dependency on WinRT, which |
| # is not available in Windows 7. |
| defines = [ "__WRL_CLASSIC_COM_STRICT__" ] |
| } |
| |
| executable("updater") { |
| sources = [ |
| "main.cc", |
| "updater.rc", |
| ] |
| |
| configs -= [ "//build/config/compiler:cet_shadow_stack" ] |
| configs += [ "//build/config/win:windowed" ] |
| |
| deps = [ |
| ":version_resources", |
| "//build/win:default_exe_manifest", |
| "//chrome/updater:base", |
| "//chrome/updater:constants_prod", |
| "//chrome/updater/win/ui/resources", |
| ] |
| |
| data_deps = [ ":uninstall.cmd" ] |
| } |
| |
| executable("updater_test") { |
| sources = [ |
| "main.cc", |
| "updater.rc", |
| ] |
| |
| configs -= [ "//build/config/compiler:cet_shadow_stack" ] |
| configs += [ "//build/config/win:windowed" ] |
| |
| deps = [ |
| ":version_resources", |
| "//build/win:default_exe_manifest", |
| "//chrome/updater:base", |
| "//chrome/updater:constants_test", |
| "//chrome/updater/win/ui/resources", |
| ] |
| |
| data_deps = [ ":uninstall.cmd" ] |
| } |
| |
| copy("signing") { |
| sources = [ |
| "$root_out_dir/certificate_tag.exe", |
| "//chrome/tools/build/win/resedit.py", |
| "//third_party/lzma_sdk/7zr.exe", |
| "signing/sign.py", |
| ] |
| |
| deps = [ "//chrome/updater/tools:certificate_tag" ] |
| |
| outputs = [ "$root_out_dir/UpdaterSigning/{{source_file_part}}" ] |
| } |
| |
| zip("updater_zip") { |
| output = "$root_build_dir/updater.zip" |
| inputs = [ |
| "$root_build_dir/UpdaterSetup.exe", |
| "$root_build_dir/UpdaterSetup_test.exe", |
| ] + get_target_outputs(":signing") |
| deps = [ |
| ":signing", |
| "//chrome/updater/win/installer", |
| "//chrome/updater/win/installer:installer_test", |
| ] |
| } |
| |
| process_version("uninstall.cmd") { |
| template_file = "setup/uninstall.cmd" |
| output = "$target_gen_dir/uninstall.cmd" |
| process_only = true |
| extra_args = [ |
| "-e", |
| "PRODUCT_FULLNAME=\"$updater_product_full_name\"", |
| "-e", |
| "COMPANY_SHORTNAME=\"$updater_company_short_name\"", |
| ] |
| } |
| |
| process_version_rc_template("version_resources") { |
| _product_fullname = "$updater_product_full_name " + "($current_cpu)" |
| if (is_debug) { |
| _product_fullname += " (debug)" |
| } |
| sources = [ "updater.ver" ] |
| output = "$target_gen_dir/updater_exe.rc" |
| extra_args = [ |
| "-e", |
| "PRODUCT_FULLNAME=\"$_product_fullname\"", |
| ] |
| } |
| |
| source_set("tag_extractor") { |
| public = [ "tag_extractor.h" ] |
| |
| sources = [ |
| "tag_extractor.cc", |
| "tag_extractor_impl.h", |
| ] |
| |
| friend = [ |
| "//chrome/updater:updater_test_sources", |
| ":updater_fuzzer", |
| ] |
| |
| # In the future, we want to rely on the base numerics headers and |
| # PeImageReader directly, but right now that isn't possible due to the |
| # visibility of the lib, so we depend on the entire base temporarily. |
| deps = [ "//base" ] |
| } |
| |
| fuzzer_test("updater_fuzzer") { |
| sources = [ "tag_extractor_fuzzer.cc" ] |
| |
| deps = [ ":tag_extractor" ] |
| |
| seed_corpus = "../test/data/tag_extractor_corpus/" |
| } |