[Android WebView] Delay destroy until DetachFromWindow
[chromium-blink-merge.git] / chrome / chrome_dll.gypi
blob7c831d3d2b86e732f514334fc53f576df63b4b83
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_resources.gyp:chrome_resources',
106                 'chrome_version_resources',
107                 '../chrome/chrome_resources.gyp:chrome_unscaled_resources',
108                 '../crypto/crypto.gyp:crypto',
109                 '../printing/printing.gyp:printing',
110                 '../net/net.gyp:net_resources',
111                 '../third_party/cld/cld.gyp:cld',
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                 '../ui/resources/cursors/aliasb.cur',
129                 '../ui/resources/cursors/cell.cur',
130                 '../ui/resources/cursors/col_resize.cur',
131                 '../ui/resources/cursors/copy.cur',
132                 '../ui/resources/cursors/none.cur',
133                 '../ui/resources/cursors/row_resize.cur',
134                 '../ui/resources/cursors/vertical_text.cur',
135                 '../ui/resources/cursors/zoom_in.cur',
136                 '../ui/resources/cursors/zoom_out.cur',
138                 # TODO:  It would be nice to have these pulled in
139                 # automatically from direct_dependent_settings in
140                 # their various targets (net.gyp:net_resources, etc.),
141                 # but that causes errors in other targets when
142                 # resulting .res files get referenced multiple times.
143                 '<(SHARED_INTERMEDIATE_DIR)/chrome/browser_resources.rc',
144                 '<(SHARED_INTERMEDIATE_DIR)/chrome/chrome_unscaled_resources.rc',
145                 '<(SHARED_INTERMEDIATE_DIR)/chrome/common_resources.rc',
146                 '<(SHARED_INTERMEDIATE_DIR)/chrome/extensions_api_resources.rc',
147                 '<(SHARED_INTERMEDIATE_DIR)/content/content_resources.rc',
148                 '<(SHARED_INTERMEDIATE_DIR)/content/browser/tracing/tracing_resources.rc',
149                 '<(SHARED_INTERMEDIATE_DIR)/net/net_resources.rc',
150                 '<(SHARED_INTERMEDIATE_DIR)/ui/ui_resources/ui_unscaled_resources.rc',
151                 '<(SHARED_INTERMEDIATE_DIR)/webkit/blink_resources.rc',
152               ],
153               'include_dirs': [
154                 '<(DEPTH)/third_party/wtl/include',
155               ],
156               'configurations': {
157                 'Debug_Base': {
158                   'msvs_settings': {
159                     'VCLinkerTool': {
160                       'LinkIncremental': '<(msvs_large_module_debug_link_mode)',
161                     },
162                   },
163                 },
164               },
165               'msvs_settings': {
166                 'VCLinkerTool': {
167                   'BaseAddress': '0x01c30000',
168                   'ImportLibrary': '$(OutDir)\\lib\\chrome_dll.lib',
169                   # Set /SUBSYSTEM:WINDOWS for chrome.dll (for consistency).
170                   'SubSystem': '2',
171                   'conditions': [
172                     ['incremental_chrome_dll==1', {
173                       'OutputFile': '$(OutDir)\\initial\\chrome.dll',
174                       'UseLibraryDependencyInputs': "true",
175                     }],
176                     ['target_arch=="ia32"', {
177                       # Link against the XP-constrained user32 import library
178                       # instead of the platform-SDK provided one to avoid
179                       # inadvertently taking dependencies on post-XP user32
180                       # exports.
181                       'AdditionalDependencies!': [
182                         'user32.lib',
183                       ],
184                       'IgnoreDefaultLibraryNames': [
185                         'user32.lib',
186                       ],
187                       # Remove user32 delay load for chrome.dll.
188                       'DelayLoadDLLs!': [
189                         'user32.dll',
190                       ],
191                       'AdditionalDependencies': [
192                         'user32.winxp.lib',
193                       ],
194                       'DelayLoadDLLs': [
195                         'user32-delay.dll',
196                       ],
197                       'AdditionalLibraryDirectories': [
198                         '<(DEPTH)/build/win/importlibs/x86',
199                       ],
200                       'ForceSymbolReferences': [
201                         # Force the inclusion of the delay load hook in this
202                         # binary.
203                         '_ChromeDelayLoadHook@8',
204                       ],
205                     }],
206                   ],
207                   'DelayLoadDLLs': [
208                     'comdlg32.dll',
209                     'crypt32.dll',
210                     'cryptui.dll',
211                     'dhcpcsvc.dll',
212                     'imagehlp.dll',
213                     'imm32.dll',
214                     'iphlpapi.dll',
215                     'setupapi.dll',
216                     'urlmon.dll',
217                     'winhttp.dll',
218                     'wininet.dll',
219                     'winspool.drv',
220                     'ws2_32.dll',
221                     'wsock32.dll',
222                   ],
223                 },
224                 'VCManifestTool': {
225                   'AdditionalManifestFiles': [
226                     '$(ProjectDir)\\app\\chrome.dll.manifest',
227                   ],
228                 },
229               },
230               'conditions': [
231                 ['win_use_allocator_shim==1', {
232                   'dependencies': [
233                     '<(allocator_target)',
234                   ],
235                 }],
236               ]
237             }],
238             ['chrome_multiple_dll==1', {
239               'defines': [
240                 'CHROME_MULTIPLE_DLL_BROWSER',
241               ],
242             }, {
243               'dependencies': [
244                 '<@(chromium_child_dependencies)',
245                 '../content/content.gyp:content_app_child',
246                 '../content/content.gyp:content_worker',
247               ],
248             }],
249             ['OS=="mac" and component!="shared_library"', {
250               'includes': [ 'chrome_dll_bundle.gypi' ],
251             }],
252             ['OS=="mac" and component=="shared_library"', {
253               'xcode_settings': { 'OTHER_LDFLAGS': [ '-Wl,-ObjC' ], },
254             }],
255             ['OS=="mac"', {
256               'xcode_settings': {
257                 # Define the order of symbols within the framework.  This
258                 # sets -order_file.
259                 'ORDER_FILE': 'app/framework.order',
260               },
261               'sources': [
262                 'app/chrome_command_ids.h',
263                 'app/chrome_dll_resource.h',
264                 'app/chrome_main.cc',
265                 'app/chrome_main_delegate.cc',
266                 'app/chrome_main_delegate.h',
267                 'app/chrome_main_mac.mm',
268                 'app/chrome_main_mac.h',
269               ],
270               'include_dirs': [
271                 '<(grit_out_dir)',
272               ],
273               'postbuilds': [
274                 {
275                   # This step causes an error to be raised if the .order file
276                   # does not account for all global text symbols.  It
277                   # validates the completeness of the .order file.
278                   'postbuild_name': 'Verify global text symbol order',
279                   'variables': {
280                     'verify_order_path': 'tools/build/mac/verify_order',
281                   },
282                   'action': [
283                     '<(verify_order_path)',
284                     '_ChromeMain',
285                     '${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}',
286                   ],
287                 },
288               ],
289               'conditions': [
290                 ['mac_breakpad_compiled_in==1', {
291                   'dependencies': [
292                     '../breakpad/breakpad.gyp:breakpad',
293                     '../components/components.gyp:breakpad_component',
294                     'app/policy/cloud_policy_codegen.gyp:policy',
295                   ],
296                   'sources': [
297                     'app/breakpad_mac.mm',
298                     'app/breakpad_mac.h',
299                     'app/chrome_breakpad_client.cc',
300                     'app/chrome_breakpad_client.h',
301                     'app/chrome_breakpad_client_mac.mm',
302                   ],
303                 }, {  # else: mac_breakpad_compiled_in!=1
304                   # No Breakpad, put in the stubs.
305                   'dependencies': [
306                     '../components/components.gyp:breakpad_stubs',
307                   ],
308                   'sources': [
309                     'app/breakpad_mac_stubs.mm',
310                     'app/breakpad_mac.h',
311                   ],
312                 }],  # mac_breakpad_compiled_in
313                 ['internal_pdf', {
314                   'dependencies': [
315                     '../pdf/pdf.gyp:pdf',
316                   ],
317                 }],
318               ],  # conditions
319             }],  # OS=="mac"
320           ],  # conditions
321         },  # target chrome_main_dll
322       ],  # targets
323     }],  # OS=="mac" or OS=="win"
324     ['OS=="win"', {
325       'targets': [
326         {
327           # This target is only depended upon on Windows.
328           'target_name': 'chrome_dll_pdb_workaround',
329           'type': 'static_library',
330           'sources': [ 'empty_pdb_workaround.cc' ],
331           'conditions': [
332             ['fastbuild==0 or win_z7!=0', {
333              'msvs_settings': {
334               'VCCLCompilerTool': {
335                 # This *in the compile phase* must match the pdb name that's
336                 # output by the final link. See empty_pdb_workaround.cc for
337                 # more details.
338                 'DebugInformationFormat': '3',
339                 'ProgramDataBaseFileName': '<(PRODUCT_DIR)/chrome.dll.pdb',
340               },
341              },
342             }],
343           ],
344         },
345       ],
346     }],
347     ['chrome_multiple_dll', {
348       'targets': [
349         {
350           'target_name': 'chrome_child_dll',
351           'type': 'shared_library',
352           'product_name': 'chrome_child',
353           'variables': {
354             'enable_wexit_time_destructors': 1,
355           },
356           'dependencies': [
357             '<@(chromium_child_dependencies)',
358             '../content/content.gyp:content_app_child',
359             '../content/content.gyp:content_worker',
360             'chrome_version_resources',
361             'policy_path_parser',
362           ],
363           'defines': [
364             'CHROME_MULTIPLE_DLL_CHILD',
365           ],
366           'sources': [
367             '<(SHARED_INTERMEDIATE_DIR)/chrome/common_resources.rc',
368             '<(SHARED_INTERMEDIATE_DIR)/chrome/extensions_api_resources.rc',
369             '<(SHARED_INTERMEDIATE_DIR)/chrome_version/chrome_dll_version.rc',
370             'app/chrome_main.cc',
371             'app/chrome_main_delegate.cc',
372             'app/chrome_main_delegate.h',
373           ],
374         },  # target chrome_child_dll
375       ],
376     }],
377   ],