summaryrefslogtreecommitdiff
path: root/chromium/chrome/installer/setup/BUILD.gn
blob: 742aac1ea3fa05c512a80dac2e9b15d34b110be3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
# Copyright 2015 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/buildflag_header.gni")
import("//build/config/chrome_build.gni")
import("//chrome/installer/setup/buildflags.gni")
import("//chrome/process_version_rc_template.gni")
import("//testing/test.gni")

buildflag_header("buildflags") {
  header = "buildflags.h"
  flags = [ "ZUCCHINI=$use_zucchini" ]
}

if (is_win) {
  executable("setup") {
    sources = [
      "setup.rc",
      "setup_main.cc",
      "setup_main.h",
      "setup_resource.h",
      "uninstall.cc",
      "uninstall.h",
    ]

    configs -= [
      "//build/config/compiler:cet_shadow_stack",
      "//build/config/win:console",
    ]
    configs += [ "//build/config/win:windowed" ]

    deps = [
      ":buildflags",
      ":lib",
      ":setup_exe_version",
      "//base",
      "//build:branding_buildflags",
      "//build/win:default_exe_manifest",
      "//chrome/chrome_elf:constants",
      "//chrome/common:constants",
      "//chrome/install_static:install_static_util",
      "//chrome/installer/util:with_rc_strings",
      "//components/crash/core/app:app",
      "//components/crash/core/app:crash_export_thunks",
      "//components/crash/core/app:run_as_crashpad_handler",
      "//content/public/common:static_switches",
#      "//rlz:rlz_lib_no_network",
    ]

    libs = [ "netapi32.lib" ]
  }

  static_library("lib") {
    sources = [
      "${branding_path_component}_behaviors.cc",
      "archive_patch_helper.cc",
      "archive_patch_helper.h",
      "brand_behaviors.h",
      "install.cc",
      "install.h",
      "install_params.h",
      "install_worker.cc",
      "install_worker.h",
      "installer_crash_reporter_client.cc",
      "installer_crash_reporter_client.h",
      "installer_crash_reporting.cc",
      "installer_crash_reporting.h",
      "installer_state.cc",
      "installer_state.h",
      "launch_chrome.cc",
      "launch_chrome.h",
      "modify_params.h",
      "progress_calculator.cc",
      "progress_calculator.h",
      "setup_constants.cc",
      "setup_constants.h",
      "setup_install_details.cc",
      "setup_install_details.h",
      "setup_singleton.cc",
      "setup_singleton.h",
      "setup_util.cc",
      "setup_util.h",
      "update_active_setup_version_work_item.cc",
      "update_active_setup_version_work_item.h",
      "user_experiment.cc",
      "user_experiment.h",
      "user_hive_visitor.cc",
      "user_hive_visitor.h",
    ]

    public_deps = [
      ":buildflags",
      "//base",
      "//chrome/installer/util:with_rc_strings",
    ]

    deps = [
      "//build:branding_buildflags",
      "//chrome/common:constants",
      "//chrome/common:version_header",
      "//chrome/install_static:buildflags",
      "//chrome/install_static:install_static_util",
      "//components/base32",
      "//components/crash/core/app",
      "//components/crash/core/common",
      "//components/metrics",
      "//components/zucchini:zucchini_io",
      "//components/zucchini:zucchini_lib",
      "//courgette:courgette_lib",
      "//third_party/bspatch",
      "//third_party/crashpad/crashpad/client",
      "//third_party/crashpad/crashpad/util",
      "//ui/base:fullscreen_win",
    ]
  }

  process_version_rc_template("setup_exe_version") {
    template_file = "setup_exe_version.rc.version"
    output = "$target_gen_dir/setup_exe_version.rc"
  }

  # This test covers the mini installer and setup tests.
  test("setup_unittests") {
    sources = [
      "archive_patch_helper_unittest.cc",
      "install_unittest.cc",
      "install_worker_unittest.cc",
      "installer_state_unittest.cc",
      "memory_unittest.cc",
      "progress_calculator_unittest.cc",
      "run_all_unittests.cc",
      "setup_install_details_unittest.cc",
      "setup_singleton_unittest.cc",
      "setup_util_unittest.cc",
      "setup_util_unittest.h",
      "update_active_setup_version_work_item_unittest.cc",
      "user_experiment_unittest.cc",
      "user_hive_visitor_unittest.cc",
    ]

    deps = [
      ":lib",
      "//base",
      "//base:i18n",
      "//base/allocator:buildflags",
      "//base/test:test_support",
      "//build:branding_buildflags",
      "//chrome/common:constants",
      "//chrome/common:version_header",
      "//chrome/install_static:buildflags",
      "//chrome/install_static:install_static_util",
      "//chrome/install_static/test:test_support",
      "//chrome/installer/mini_installer:unit_tests",
      "//chrome/installer/util:serial_unittests",
      "//chrome/installer/util:test_support",
      "//components/crash/core/app:test_support",
      "//testing/gmock",
      "//testing/gtest",
    ]

    data = [
      "//chrome/installer/test/data/",
      "//chrome/test/data/installer/",
    ]

    libs = [ "netapi32.lib" ]
  }
}