[Android] Added UMA for search by image context menu.
[chromium-blink-merge.git] / chrome / installer / mini_installer.gyp
blob05d54d2875c61f964d85957a7a1262532f65b707
2   'variables': {
3     'version_py': '../../chrome/tools/build/version.py',
4     'version_path': '../../chrome/VERSION',
5     'lastchange_path': '<(DEPTH)/build/util/LASTCHANGE',
6     # 'branding_dir' is set in the 'conditions' section at the bottom.
7     'msvs_use_common_release': 0,
8     'msvs_use_common_linker_extras': 0,
9     'mini_installer_internal_deps%': 0,
10     'mini_installer_official_deps%': 0,
11   },
12   'includes': [
13     '../../build/win_precompile.gypi',
14   ],
15   'conditions': [
16     ['OS=="win"', {
17       'target_defaults': {
18         'dependencies': [
19           '../chrome.gyp:app_host',
20           '../chrome.gyp:chrome',
21           '../chrome.gyp:chrome_nacl_win64',
22           '../chrome.gyp:chrome_dll',
23           '../chrome.gyp:default_extensions',
24           '../chrome.gyp:setup',
25         ],
26         'include_dirs': [
27           '../..',
28           '<(INTERMEDIATE_DIR)',
29           '<(SHARED_INTERMEDIATE_DIR)/chrome',
30         ],
31         'sources': [
32           'mini_installer/appid.h',
33           'mini_installer/configuration.cc',
34           'mini_installer/configuration.h',
35           'mini_installer/decompress.cc',
36           'mini_installer/decompress.h',
37           'mini_installer/mini_installer.cc',
38           'mini_installer/mini_installer.h',
39           'mini_installer/mini_installer.ico',
40           'mini_installer/mini_installer.rc',
41           'mini_installer/mini_installer_exe_version.rc.version',
42           'mini_installer/mini_installer_resource.h',
43           'mini_installer/mini_string.cc',
44           'mini_installer/mini_string.h',
45           'mini_installer/pe_resource.cc',
46           'mini_installer/pe_resource.h',
47           '<(INTERMEDIATE_DIR)/packed_files.rc',
48         ],
49         'msvs_settings': {
50           'VCCLCompilerTool': {
51             'EnableIntrinsicFunctions': 'true',
52             'BufferSecurityCheck': 'false',
53             'BasicRuntimeChecks': '0',
54             'ExceptionHandling': '0',
55           },
56           'VCLinkerTool': {
57             'RandomizedBaseAddress': '1',
58             'DataExecutionPrevention': '0',
59             'AdditionalLibraryDirectories': [
60               '<(PRODUCT_DIR)/lib'
61             ],
62             'DelayLoadDLLs': [],
63             'EntryPointSymbol': 'MainEntryPoint',
64             'GenerateMapFile': 'true',
65             'IgnoreAllDefaultLibraries': 'true',
66             'OptimizeForWindows98': '1',
67             'SubSystem': '2',     # Set /SUBSYSTEM:WINDOWS
68             'AdditionalDependencies': [
69               'shlwapi.lib',
70               'setupapi.lib',
71             ],
72           },
73           'VCManifestTool': {
74             'AdditionalManifestFiles': [
75               '$(ProjectDir)\\mini_installer\\mini_installer.exe.manifest',
76             ],
77           },
78         },
79         'configurations': {
80           'Debug_Base': {
81             'msvs_settings': {
82               'VCCLCompilerTool': {
83                 'BasicRuntimeChecks': '0',
84                 'BufferSecurityCheck': 'false',
85                 'ExceptionHandling': '0',
86               },
87               'VCLinkerTool': {
88                 'SubSystem': '2',     # Set /SUBSYSTEM:WINDOWS
89                 'AdditionalOptions': [
90                   '/safeseh:no',
91                   '/dynamicbase:no',
92                   '/ignore:4199',
93                   '/ignore:4221',
94                   '/nxcompat',
95                 ],
96               },
97             },
98           },
99           'Release_Base': {
100             'includes': ['../../build/internal/release_defaults.gypi'],
101             'msvs_settings': {
102               'VCCLCompilerTool': {
103                 'EnableIntrinsicFunctions': 'true',
104                 'BasicRuntimeChecks': '0',
105                 'BufferSecurityCheck': 'false',
106                 'ExceptionHandling': '0',
107               },
108               'VCLinkerTool': {
109                 'SubSystem': '2',     # Set /SUBSYSTEM:WINDOWS
110                 'Profile': 'false',   # Conflicts with /FIXED
111                 'AdditionalOptions': [
112                   '/SAFESEH:NO',
113                   '/NXCOMPAT',
114                   '/DYNAMICBASE:NO',
115                   '/FIXED',
116                 ],
117               },
118             },
119           },
120         },
121         'rules': [
122           {
123             'rule_name': 'mini_installer_version',
124             'extension': 'version',
125             'variables': {
126               'template_input_path': 'mini_installer/mini_installer_exe_version.rc.version',
127             },
128             'inputs': [
129               '<(template_input_path)',
130               '<(version_path)',
131               '<(lastchange_path)',
132               '<(branding_dir)/BRANDING',
133             ],
134             'outputs': [
135               '<(PRODUCT_DIR)/mini_installer_exe_version.rc',
136             ],
137             'action': [
138               'python', '<(version_py)',
139               '-f', '<(version_path)',
140               '-f', '<(lastchange_path)',
141               '-f', '<(branding_dir)/BRANDING',
142               '<(template_input_path)',
143               '<@(_outputs)',
144             ],
145             'process_outputs_as_sources': 1,
146             'message': 'Generating version information'
147           },
148         ],
149         # TODO(mark):  <(branding_dir) should be defined by the
150         # global condition block at the bottom of the file, but
151         # this doesn't work due to the following issue:
152         #
153         #   http://code.google.com/p/gyp/issues/detail?id=22
154         #
155         # Remove this block once the above issue is fixed.
156         'conditions': [
157           [ 'branding == "Chrome"', {
158             'variables': {
159                'branding_dir': '../app/theme/google_chrome',
160             },
161           }, { # else branding!="Chrome"
162             'variables': {
163                'branding_dir': '../app/theme/chromium',
164             },
165           }],
166         ],
167       },
168       'targets': [
169         {
170           'target_name': 'mini_installer',
171           'type': 'executable',
173           # Disable precompiled headers for this project, to avoid
174           # linker errors when building with VS 2008.
175           'msvs_precompiled_header': '',
176           'msvs_precompiled_source': '',
178           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
179           'msvs_disabled_warnings': [ 4267, ],
180           
181           'sources': [
182             'mini_installer/chrome.release',
183             'mini_installer/chrome_appid.cc',
184           ],
185           'rules': [
186             {
187               'rule_name': 'installer_archive',
188               'extension': 'release',
189               'variables': {
190                 'create_installer_archive_py_path':
191                   '../tools/build/win/create_installer_archive.py',
192               },
193               'conditions': [
194                 ['enable_hidpi == 1', {
195                   'variables': {
196                     'enable_hidpi_flag': '--enable_hidpi=1',
197                   },
198                 }, {
199                   'variables': {
200                     'enable_hidpi_flag': '',
201                   },
202                 }],
203                 ['enable_touch_ui == 1', {
204                   'variables': {
205                     'enable_touch_ui_flag': '--enable_touch_ui=1',
206                   },
207                 }, {
208                   'variables': {
209                     'enable_touch_ui_flag': '',
210                   },
211                 }],
212                 ['component == "shared_library"', {
213                   'variables': {
214                     'component_build_flag': '--component_build=1',
215                   },
216                 }, {
217                   'variables': {
218                     'component_build_flag': '',
219                   },
220                   'outputs': [
221                     '<(PRODUCT_DIR)/<(RULE_INPUT_NAME).packed.7z',
222                   ],
223                 }],
224                 ['disable_nacl==1', {
225                   'inputs!': [
226                     '<(PRODUCT_DIR)/nacl64.exe',
227                     '<(PRODUCT_DIR)/ppGoogleNaClPluginChrome.dll',
228                     '<(PRODUCT_DIR)/nacl_irt_x86_32.nexe',
229                     '<(PRODUCT_DIR)/nacl_irt_x86_64.nexe',
230                   ],
231                 }],
232                 ['target_arch=="x64"', {
233                   'inputs!': [
234                     '<(PRODUCT_DIR)/nacl64.exe',
235                     '<(PRODUCT_DIR)/nacl_irt_x86_32.nexe',
236                   ],
237                   'variables': {
238                     'target_arch_flag': '--target_arch=x64',
239                   },
240                 }, {
241                   'variables': {
242                     'target_arch_flag': '--target_arch=x86',
243                   },
244                 }],
245               ],
246               'inputs': [
247                 '<(create_installer_archive_py_path)',
248                 '<(PRODUCT_DIR)/app_host.exe',
249                 '<(PRODUCT_DIR)/chrome.exe',
250                 '<(PRODUCT_DIR)/chrome.dll',
251                 '<(PRODUCT_DIR)/nacl64.exe',
252                 '<(PRODUCT_DIR)/ppGoogleNaClPluginChrome.dll',
253                 '<(PRODUCT_DIR)/nacl_irt_x86_32.nexe',
254                 '<(PRODUCT_DIR)/nacl_irt_x86_64.nexe',
255                 '<(PRODUCT_DIR)/locales/en-US.pak',
256                 '<(PRODUCT_DIR)/icudt.dll',
257               ],
258               'outputs': [
259                 # Also note that chrome.packed.7z is defined as an output in a
260                 # conditional above.
261                 'xxx2.out',
262                 '<(PRODUCT_DIR)/<(RULE_INPUT_NAME).7z',
263                 '<(PRODUCT_DIR)/setup.ex_',
264                 '<(INTERMEDIATE_DIR)/packed_files.rc',
265               ],
266               'action': [
267                 'python',
268                 '<(create_installer_archive_py_path)',
269                 '--build_dir', '<(PRODUCT_DIR)',
270                 '--staging_dir', '<(INTERMEDIATE_DIR)',
271                 '--input_file', '<(RULE_INPUT_PATH)',
272                 '--resource_file_path', '<(INTERMEDIATE_DIR)/packed_files.rc',
273                 '<(enable_hidpi_flag)',
274                 '<(enable_touch_ui_flag)',
275                 '<(component_build_flag)',
276                 '<(target_arch_flag)',
277                 # TODO(sgk):  may just use environment variables
278                 #'--distribution=$(CHROMIUM_BUILD)',
279                 '--distribution=_google_chrome',
280                 # Optional arguments to generate diff installer
281                 #'--last_chrome_installer=C:/Temp/base',
282                 #'--setup_exe_format=DIFF',
283                 #'--diff_algorithm=COURGETTE',
284               ],
285               'message': 'Create installer archive',
286               'msvs_cygwin_shell': 1,
287             },
288           ],
289         },
290       ],
291     }],
292     [ 'branding == "Chrome"', {
293       'variables': {
294          'branding_dir': '../app/theme/google_chrome',
295       },
296     }, { # else branding!="Chrome"
297       'variables': {
298          'branding_dir': '../app/theme/chromium',
299       },
300     }],
301   ],