| # Copyright 2016 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/chrome_build.gni") |
| import("//testing/test.gni") |
| |
| assert(is_win) |
| |
| # This file only contains utility functions which must only depend on kernel32. |
| # Please don't add dependencies on other system libraries. |
| static_library("install_static_util") { |
| deps = [ |
| "//components/version_info:generate_version_info", |
| ] |
| |
| public_deps = [ |
| "//chrome_elf:nt_registry", |
| ] |
| |
| sources = [ |
| "../app/chrome_dll_resource.h", |
| "install_constants.h", |
| "install_details.cc", |
| "install_details.h", |
| "install_modes.cc", |
| "install_modes.h", |
| "install_util.cc", |
| "install_util.h", |
| "policy_path_parser.cc", |
| "policy_path_parser.h", |
| "product_install_details.cc", |
| "product_install_details.h", |
| "user_data_dir.cc", |
| "user_data_dir.h", |
| ] |
| |
| if (is_chrome_branded) { |
| sources += [ |
| "google_chrome_install_modes.cc", |
| "google_chrome_install_modes.h", |
| ] |
| } else { |
| sources += [ |
| "chromium_install_modes.cc", |
| "chromium_install_modes.h", |
| ] |
| } |
| |
| libs = [ "kernel32.lib" ] |
| |
| configs += [ |
| # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. |
| "//build/config/compiler:no_size_t_to_int_warning", |
| ] |
| } |
| |
| # A source set for use by the module in a process that creates the process-wide |
| # InstallDetails instance (i.e., chrome_elf.dll). |
| source_set("primary_module") { |
| sources = [ |
| "get_install_details_payload.cc", |
| ] |
| } |
| |
| # A source set for use by modules in a process that fetch the process-wide |
| # InstallDetails instance from the primary module by way of |
| # GetInstallDetailsPayload (i.e., chrome.exe, chrome.dll, chrome_child.dll, and |
| # chrome_watcher.dll). |
| source_set("secondary_module") { |
| sources = [ |
| "initialize_from_primary_module.cc", |
| "initialize_from_primary_module.h", |
| ] |
| deps = [ |
| ":install_static_util", |
| ] |
| } |
| |
| test("install_static_unittests") { |
| output_name = "install_static_unittests" |
| sources = [ |
| "install_details_unittest.cc", |
| "install_modes_unittest.cc", |
| "install_util_unittest.cc", |
| "product_install_details_unittest.cc", |
| "user_data_dir_win_unittest.cc", |
| ] |
| include_dirs = [ "$target_gen_dir" ] |
| deps = [ |
| "//base", |
| "//base/test:run_all_unittests", |
| "//base/test:test_support", |
| "//chrome/install_static:install_static_util", |
| "//chrome/install_static/test:test_support", |
| "//testing/gmock", |
| "//testing/gtest", |
| ] |
| } |