Update CrOS OOBE throbber to MD throbber; delete old asset
[chromium-blink-merge.git] / chrome / installer / mini_installer / BUILD.gn
blob7f33a27d4fe653b518ca60c1f6410fc79ef92e27
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
3 # found in the LICENSE file.
5 import("//build/config/features.gni")
6 import("//build/config/ui.gni")
7 import("//build/module_args/v8.gni")
8 import("//third_party/icu/config.gni")
10 config("mini_installer_compiler_flags") {
11   cflags = [
12     "/bigobj",
13     "/Gy",  # Enable function-level linking.
14     "/GS-",  # Disable buffer security checking.
15   ]
17   cflags_c = [ "/TC" ]
18   cflags_cc = [ "/TP" ]
21 source_set("lib") {
22   sources = [
23     "appid.h",
24     "chrome.release",
25     "chrome_appid.cc",
26     "configuration.cc",
27     "configuration.h",
28     "decompress.cc",
29     "decompress.h",
30     "mini_installer.ico",
31     "mini_installer.rc",
32     "mini_installer_constants.cc",
33     "mini_installer_constants.h",
34     "mini_installer_resource.h",
35     "mini_string.cc",
36     "mini_string.h",
37     "pe_resource.cc",
38     "pe_resource.h",
39     "regkey.cc",
40     "regkey.h",
41   ]
43   deps = [
44     #"test_installer_sentinel",  TODO(GYP) bug 521052.
45   ]
48 source_set("unit_tests") {
49   testonly = true
51   sources = [
52     "configuration_test.cc",
53     "decompress_test.cc",
54     "mini_string_test.cc",
55   ]
57   public_deps = [
58     ":lib",
59   ]
60   deps = [
61     "//testing/gtest",
62   ]
65 packed_files_rc_file = "$target_gen_dir/packed_files.rc"
67 action("archive") {
68   script = "//chrome/tools/build/win/create_installer_archive.py"
70   release_file = "chrome.release"
72   inputs = [
73     "$root_out_dir/chrome.exe",
74     "$root_out_dir/chrome.dll",
75     "$root_out_dir/locales/en-US.pak",
76     "$root_out_dir/setup.exe",
77     release_file,
78   ]
80   outputs = [
81     # See also chrome.packed.7z conditionally added below.
82     "$root_out_dir/chrome.7z",
83     "$root_out_dir/setup.ex_",
84     packed_files_rc_file,
85   ]
86   args = [
87     "--build_dir",
88     rebase_path(root_out_dir, root_build_dir),
89     "--staging_dir",
90     rebase_path(root_gen_dir, root_build_dir),
91     "--input_file",
92     rebase_path(release_file, root_build_dir),
93     "--resource_file_path",
94     rebase_path(packed_files_rc_file, root_build_dir),
95     "--target_arch=$current_cpu",
96     "--distribution=_google_chrome",
98     # Optional arguments to generate diff installer.
99     #'--last_chrome_installer=C:/Temp/base',
100     #'--setup_exe_format=DIFF',
101     #'--diff_algorithm=COURGETTE',
102   ]
104   if (enable_hidpi) {
105     args += [ "--enable_hidpi=1" ]
106   }
107   if (is_component_build) {
108     args += [ "--component_build=1" ]
109   } else {
110     outputs += [ "$root_out_dir/chrome.packed.7z" ]
111   }
113   if (enable_nacl) {
114     inputs += [ "$root_out_dir/nacl_irt_x86_64.nexe" ]
115     if (cpu_arch == "x86") {
116       inputs += [
117         "$root_out_dir/nacl64.exe",
118         "$root_out_dir/nacl_irt_x86_32.nexe",
119       ]
120     }
121   }
123   if (icu_use_data_file) {
124     inputs += [ "$root_out_dir/icudtl.dat" ]
125   } else {
126     inputs += [ "$root_out_dir/icudt.dll" ]
127   }
129   if (v8_use_external_startup_data) {
130     inputs += [
131       "$root_out_dir/natives_blob.bin",
132       "$root_out_dir/snapshot_blob.bin",
133     ]
134   }
136   depfile = "$target_gen_dir/archive.d"
137   args += [
138     "--depfile",
139     rebase_path(depfile, root_build_dir),
140   ]
142   deps = [
143     "//chrome",
144     "//chrome:main_dll",
145     "//chrome/installer/setup",
146     "//third_party/icu:icudata",
148     #"../chrome.gyp:chrome_nacl_win64",  TODO(GYP) bug 512869.
149     #"../chrome.gyp:default_extensions",  TODO(GYP) bug 521048.
150   ]
153 # TODO(GYP) bug 521052: This target needs to be checked to make sure its the
154 # same size as the GYP build.
155 executable("mini_installer") {
156   sources = [
157     "mini_installer.cc",
158     "mini_installer_exe_version.rc.version",
159     packed_files_rc_file,
160   ]
162   # This target is special so we manually override most linker flags and
163   # specify our own to keep the size down.
164   configs -= [
165     "//build/config/compiler:compiler",
166     "//build/config/win:common_linker_setup",
167     "//build/config/win:console",
168   ]
169   configs += [
170     ":mini_installer_compiler_flags",
171     "//build/config/win:windowed",
172   ]
174   ldflags = [
175     "/ENTRY:MainEntryPoint",
176     "/FIXED:NO",
177     "/NXCOMPAT",
178   ]
180   libs = [ "setupapi.lib" ]
182   deps = [
183     ":archive",
184     ":lib",
185     "//build/win:default_exe_manifest",
186     "//chrome/installer/setup",
187   ]