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