[safe browsing] Binary golden file for prefix set test.
[chromium-blink-merge.git] / chrome / chrome_dll.gypi
blobfc2cc1cbe06778a18bee950926bb86e928a102dd
1 # Copyright (c) 2012 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   'conditions': [
6     ['OS=="mac" or OS=="win"', {
7       'targets': [
8         {
9           'target_name': 'chrome_dll',
10           'type': 'none',
11           'dependencies': [
12             'chrome_main_dll',
13           ],
14           'conditions': [
15             ['OS=="mac" and component=="shared_library"', {
16               'type': 'shared_library',
17               'includes': [ 'chrome_dll_bundle.gypi' ],
18               'xcode_settings': {
19                 'OTHER_LDFLAGS': [
20                   '-Wl,-reexport_library,<(PRODUCT_DIR)/libchrome_main_dll.dylib',
21                 ],
22               },
23             }],  # OS=="mac"
24             ['chrome_multiple_dll==1', {
25               'dependencies': [
26                 'chrome_child_dll',
27               ],
28             }],
29             ['incremental_chrome_dll==1', {
30               # Linking to a different directory and then hardlinking back
31               # to OutDir is a workaround to avoid having the .ilk for
32               # chrome.exe and chrome.dll conflicting. See crbug.com/92528
33               # for more information. Done on the dll instead of the exe so
34               # that people launching from VS don't need to modify
35               # $(TargetPath) for the exe.
36               'actions': [
37                 {
38                   'action_name': 'hardlink_to_output',
39                   'inputs': [
40                     '$(OutDir)\\initial\\chrome.dll',
41                   ],
42                   'outputs': [
43                     '$(OutDir)\\chrome.dll',
44                   ],
45                   'action': ['tools\\build\\win\\hardlink_failsafe.bat',
46                              '$(OutDir)\\initial\\chrome.dll',
47                              '$(OutDir)\\chrome.dll'],
48                 },
49               ],
50               'conditions': [
51                 # Only hardlink pdb if we're generating debug info.
52                 ['fastbuild==0 or win_z7!=0', {
53                   'actions': [
54                     {
55                       'action_name': 'hardlink_pdb_to_output',
56                       'inputs': [
57                         # Not the pdb, since gyp doesn't know about it
58                         '$(OutDir)\\initial\\chrome.dll',
59                       ],
60                       'outputs': [
61                         '$(OutDir)\\chrome.dll.pdb',
62                       ],
63                       'action': ['tools\\build\\win\\hardlink_failsafe.bat',
64                                  '$(OutDir)\\initial\\chrome.dll.pdb',
65                                  '$(OutDir)\\chrome.dll.pdb'],
66                     }
67                   ]
68                 }]
69               ],
70             }],
71           ]
72         },
73         {
74           'target_name': 'chrome_main_dll',
75           'type': 'shared_library',
76           'variables': {
77             'enable_wexit_time_destructors': 1,
78           },
79           'dependencies': [
80             '<@(chromium_browser_dependencies)',
81             '../components/components.gyp:policy',
82             '../content/content.gyp:content_app_browser',
83           ],
84           'conditions': [
85             ['OS=="win"', {
86               'dependencies': [
87                 '<(DEPTH)/chrome_elf/chrome_elf.gyp:chrome_elf',
88               ],
89             }],
90             ['use_aura==1', {
91               'dependencies': [
92                 '../ui/compositor/compositor.gyp:compositor',
93               ],
94             }],
95             ['OS=="win" and target_arch=="ia32"', {
96               # Add a dependency to custom import library for user32 delay
97               # imports only in x86 builds.
98               'dependencies': [
99                 'chrome_user32_delay_imports',
100               ],
101             },],
102             ['OS=="win"', {
103               'product_name': 'chrome',
104               'dependencies': [
105                 # On Windows, link the dependencies (libraries) that make
106                 # up actual Chromium functionality into this .dll.
107                 'chrome_dll_pdb_workaround',
108                 'chrome_version_resources',
109                 '../chrome/chrome_resources.gyp:chrome_unscaled_resources',
110                 '../crypto/crypto.gyp:crypto',
111                 '../net/net.gyp:net_resources',
112                 '../ui/views/views.gyp:views',
113                 '../webkit/webkit_resources.gyp:webkit_resources',
114               ],
115               'sources': [
116                 'app/chrome_command_ids.h',
117                 'app/chrome_dll.rc',
118                 'app/chrome_dll_resource.h',
119                 'app/chrome_main.cc',
120                 'app/chrome_main_delegate.cc',
121                 'app/chrome_main_delegate.h',
122                 'app/delay_load_hook_win.cc',
123                 'app/delay_load_hook_win.h',
125                 '<(SHARED_INTERMEDIATE_DIR)/chrome_version/chrome_dll_version.rc',
126                 '../base/win/dllmain.cc',
128                 # Cursors.
129                 '<(SHARED_INTERMEDIATE_DIR)/ui/ui_resources/ui_unscaled_resources.rc',
130               ],
131               'include_dirs': [
132                 '<(DEPTH)/third_party/wtl/include',
133               ],
134               'configurations': {
135                 'Debug_Base': {
136                   'msvs_settings': {
137                     'VCLinkerTool': {
138                       'LinkIncremental': '<(msvs_large_module_debug_link_mode)',
139                     },
140                   },
141                 },
142               },
143               'msvs_settings': {
144                 'VCLinkerTool': {
145                   'ImportLibrary': '$(OutDir)\\lib\\chrome_dll.lib',
146                   # Set /SUBSYSTEM:WINDOWS for chrome.dll (for consistency).
147                   'SubSystem': '2',
148                   'conditions': [
149                     ['incremental_chrome_dll==1', {
150                       'OutputFile': '$(OutDir)\\initial\\chrome.dll',
151                       'UseLibraryDependencyInputs': "true",
152                     }],
153                     ['target_arch=="ia32"', {
154                       # Don't set an x64 base address (to avoid breaking HE-ASLR).
155                       'BaseAddress': '0x01c30000',
156                       # Link against the XP-constrained user32 import library
157                       # instead of the platform-SDK provided one to avoid
158                       # inadvertently taking dependencies on post-XP user32
159                       # exports.
160                       'AdditionalDependencies!': [
161                         'user32.lib',
162                       ],
163                       'IgnoreDefaultLibraryNames': [
164                         'user32.lib',
165                       ],
166                       # Remove user32 delay load for chrome.dll.
167                       'DelayLoadDLLs!': [
168                         'user32.dll',
169                       ],
170                       'AdditionalDependencies': [
171                         'user32.winxp.lib',
172                       ],
173                       'DelayLoadDLLs': [
174                         'user32-delay.dll',
175                       ],
176                       'AdditionalLibraryDirectories': [
177                         '<(DEPTH)/build/win/importlibs/x86',
178                       ],
179                       'ForceSymbolReferences': [
180                         # Force the inclusion of the delay load hook in this
181                         # binary.
182                         '_ChromeDelayLoadHook@8',
183                       ],
184                     }],
185                   ],
186                   'DelayLoadDLLs': [
187                     'comdlg32.dll',
188                     'crypt32.dll',
189                     'cryptui.dll',
190                     'dhcpcsvc.dll',
191                     'imagehlp.dll',
192                     'imm32.dll',
193                     'iphlpapi.dll',
194                     'setupapi.dll',
195                     'urlmon.dll',
196                     'winhttp.dll',
197                     'wininet.dll',
198                     'winspool.drv',
199                     'ws2_32.dll',
200                     'wsock32.dll',
201                   ],
202                 },
203                 'VCManifestTool': {
204                   'AdditionalManifestFiles': [
205                     '$(ProjectDir)\\app\\chrome.dll.manifest',
206                   ],
207                 },
208               },
209               'conditions': [
210                 ['win_use_allocator_shim==1', {
211                   'dependencies': [
212                     '<(allocator_target)',
213                   ],
214                 }],
215                 ['enable_printing!=0', {
216                   'dependencies': [
217                     '../printing/printing.gyp:printing',
218                   ],
219                 }],
220                 ['chrome_pgo_phase==1', {
221                   'msvs_settings': {
222                     'VCLinkerTool': {
223                       'LinkTimeCodeGeneration': '2',
224                     },
225                   },
226                 }],
227                 ['chrome_pgo_phase==2', {
228                   'msvs_settings': {
229                     'VCLinkerTool': {
230                       'LinkTimeCodeGeneration': '3',
231                     },
232                   },
233                 }],
234               ]
235             }],
236             ['chrome_multiple_dll==1', {
237               'defines': [
238                 'CHROME_MULTIPLE_DLL_BROWSER',
239               ],
240             }, {
241               'dependencies': [
242                 '<@(chromium_child_dependencies)',
243                 '../content/content.gyp:content_app_both',
244                 '../content/content.gyp:content_worker',
245               ],
246               'dependencies!': [
247                 '../content/content.gyp:content_app_browser',
248               ],
249             }],
250             ['cld_version==0 or cld_version==1', {
251               'dependencies': [
252                 '../third_party/cld/cld.gyp:cld',
253               ],
254             }],
255             ['cld_version==0 or cld_version==2', {
256               'dependencies': [
257                 '../third_party/cld_2/cld_2.gyp:cld_2',
258               ],
259             }],
260             ['OS=="mac" and component!="shared_library"', {
261               'includes': [ 'chrome_dll_bundle.gypi' ],
262             }],
263             ['OS=="mac" and component=="shared_library"', {
264               'xcode_settings': { 'OTHER_LDFLAGS': [ '-Wl,-ObjC' ], },
265             }],
266             ['OS=="mac"', {
267               'xcode_settings': {
268                 # Define the order of symbols within the framework.  This
269                 # sets -order_file.
270                 'ORDER_FILE': 'app/framework.order',
271               },
272               'sources': [
273                 'app/chrome_command_ids.h',
274                 'app/chrome_dll_resource.h',
275                 'app/chrome_main.cc',
276                 'app/chrome_main_delegate.cc',
277                 'app/chrome_main_delegate.h',
278                 'app/chrome_main_mac.mm',
279                 'app/chrome_main_mac.h',
280               ],
281               'include_dirs': [
282                 '<(grit_out_dir)',
283               ],
284               'postbuilds': [
285                 {
286                   # This step causes an error to be raised if the .order file
287                   # does not account for all global text symbols.  It
288                   # validates the completeness of the .order file.
289                   'postbuild_name': 'Verify global text symbol order',
290                   'variables': {
291                     'verify_order_path': 'tools/build/mac/verify_order',
292                   },
293                   'action': [
294                     '<(verify_order_path)',
295                     '_ChromeMain',
296                     '${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}',
297                   ],
298                 },
299               ],
300               'conditions': [
301                 ['mac_breakpad_compiled_in==1', {
302                   'dependencies': [
303                     '../breakpad/breakpad.gyp:breakpad',
304                     '../components/components.gyp:breakpad_component',
305                     '../components/components.gyp:policy',
306                   ],
307                   'sources': [
308                     'app/chrome_breakpad_client.cc',
309                     'app/chrome_breakpad_client.h',
310                     'app/chrome_breakpad_client_mac.mm',
311                   ],
312                 }, {  # else: mac_breakpad_compiled_in!=1
313                   # No Breakpad, put in the stubs.
314                   'dependencies': [
315                     '../components/components.gyp:breakpad_stubs',
316                   ],
317                 }],  # mac_breakpad_compiled_in
318                 ['internal_pdf', {
319                   'dependencies': [
320                     '../pdf/pdf.gyp:pdf',
321                   ],
322                 }],
323               ],  # conditions
324             }],  # OS=="mac"
325           ],  # conditions
326         },  # target chrome_main_dll
327       ],  # targets
328     }],  # OS=="mac" or OS=="win"
329     ['OS=="win"', {
330       'targets': [
331         {
332           # This target is only depended upon on Windows.
333           'target_name': 'chrome_dll_pdb_workaround',
334           'type': 'static_library',
335           'sources': [ 'empty_pdb_workaround.cc' ],
336           'conditions': [
337             ['fastbuild==0 or win_z7!=0', {
338              'msvs_settings': {
339               'VCCLCompilerTool': {
340                 # This *in the compile phase* must match the pdb name that's
341                 # output by the final link. See empty_pdb_workaround.cc for
342                 # more details.
343                 'DebugInformationFormat': '3',
344                 'ProgramDataBaseFileName': '<(PRODUCT_DIR)/chrome.dll.pdb',
345               },
346              },
347             }],
348           ],
349         },
350       ],
351     }],
352     ['chrome_multiple_dll', {
353       'targets': [
354         {
355           'target_name': 'chrome_child_dll',
356           'type': 'shared_library',
357           'product_name': 'chrome_child',
358           'variables': {
359             'enable_wexit_time_destructors': 1,
360           },
361           'dependencies': [
362             '<@(chromium_child_dependencies)',
363             '../content/content.gyp:content_app_child',
364             '../content/content.gyp:content_worker',
365             'chrome_version_resources',
366             'policy_path_parser',
367           ],
368           'defines': [
369             'CHROME_MULTIPLE_DLL_CHILD',
370           ],
371           'sources': [
372             '<(SHARED_INTERMEDIATE_DIR)/chrome_version/chrome_dll_version.rc',
373             'app/chrome_main.cc',
374             'app/chrome_main_delegate.cc',
375             'app/chrome_main_delegate.h',
376           ],
377           'conditions': [
378             ['OS=="win"', {
379               'dependencies': [
380                 '<(DEPTH)/chrome_elf/chrome_elf.gyp:chrome_elf',
381               ],
382               'conditions': [
383                 ['chrome_pgo_phase==1', {
384                   'msvs_settings': {
385                     'VCLinkerTool': {
386                       'LinkTimeCodeGeneration': '2',
387                     },
388                   },
389                 }],
390                 ['chrome_pgo_phase==2', {
391                   'msvs_settings': {
392                     'VCLinkerTool': {
393                       'LinkTimeCodeGeneration': '3',
394                     },
395                   },
396                 }],
397               ]
398             }],
399           ],
400         },  # target chrome_child_dll
401       ],
402     }],
403   ],